i try to code a backtesting strategy for tradingview.
Long Signal Generation: This occurs when the price exceeds the EMA200, indicating an uptrend. The EMAs need to be aligned (EMA25 above EMA100 and EMA100 above EMA200), and the ADX reading should be above 30. A long signal is further confirmed when the price, after dipping below the EMA25, crosses back above it within five candles.
Short Signal Generation: A short signal is generated when the price is below the EMA200, suggesting a downtrend. The EMAs should be in descending order (EMA25 below EMA100 and EMA100 below EMA.the ADX reading should be above 30. A short signal is further confirmed when the price, after dipping over the EMA25, crosses back below it within five candles.
ive tried it by myself but i tradingview didnt understand my code
Muhammed G is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.