Technical Analysis Basics for Algotrading
the main concept behind the candle sticks.
how to define the trends:
Higher High and higher lows.
In down trends we have the low below the low and highs below the previos highs.
in each period the local minimums and maximums should be calculated.
Support and Resistance:
these area are based on the historical behaviuor of seller and buyer on a market. assumptions:
- we should cut out the effect of anything that is the result of the parameters that are not recurring. like, the effects of dividends payouts, company news and… in order to have a homougenous data set, by which we can decide about the natural resistance and suppots.
- we assume that investors’ percipitation about the stock or coin did not change in the period that we are making the analysis.
as an example, the price of the SPCE is a period of Feb 2021 to March 2021 had a peak and fall, which was not normal. this was because of a special event (Test of the new spaceship), hence we should filter these data out, if we want to find the resistance and support levels in April 2021.
Manual calculations for Support and resistance and Stop loss and take profit on upward trending market.
there are a lot of different indicators that should be investigated before designing the models for bots, here are some of the most important ones.
In general, the indicators are very easy to understand and the concept behind them is highly intuitive. for simplicity let's assume the model can be assumed to be like an offline exchange or currency exchange shop. with this in mind:
Volume→ number of clients in the shop
Sell and buy price → like the sell and buy price of the USD against the local currency.
Volatility → The readiness of buyers to buy with higher prices and the sellers to sell with lower prices. it is a source that shows the level of confidence of the clients on a market/ stock/ coin. simply told, it shows the level of stress in the market or on the other side it can show the interest in the market.
Mean Price → Average price of sell and buy
VWAP → Volume Weighted Average price, sum (price * Number of currency sold)/(Volume) it is an indication of the tendency of the majority of people or main big sellers or buyers. the price corrects itself toward the VWAP.
Average True Range → in nutshell it shows that how volatile can be our prices for the currency today. i.e. if the ATR of USD to INN is 10%, we should modify the Stop loss and take profit based on that. The SL and Tp are depending on the market trend. but, as a general rule, we can use the 2–1 reward to risk on our short or long positions with the ATR calculation.
Note: For this to calculate the ATR, use the daily calculation and not the short-term periods.
the ATR calculation is simple:
- In each day (In the last 14 days period) calcualte the True Range:
TR=Max [(High-Low)or (high-close) or (Low — close)]
2. Average by the periods of the time employed. for example average of TR in the last 14 day.
3. To compare different investments, we can compare them based on ATR% which is :
the higher it is, the more volatile the share can be.
Application 1: if the people are buying at prices higher than the MA, it means that the market CAN be uptrending and vice versa.
Application 2: 20 MA, 50 MA, and 200 MA can also be used as a Resistance/support point.
Application 3: to have an approximation of the Stop Loss.