You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello all,
I am new to coding so please bare with me. I have my code compiled with no errors, but when I backtest it, no trades are bought or sold even though there are many instances where conditions are met during the test timframe.
// Execute trade based on crossovers and RSI conditions
if (long_above_short && rsiValue < RSI_Oversold_Level)
{
// Buy signal detected
BuySignal();
}
else if (short_above_long && rsiValue > RSI_Overbought_Level)
{
// Sell signal detected
SellSignal();
}
}
(market data where conditions are met)
USDSEK,M1
Date 2023.03.29
Time 20:57
Open 10.40310
High 10.40311
Low 10.39871
Close 10.39921
Tick Volume 47
Spread 358
MA(3) 10.402046
MA(30) 10.408405
MA(5) 10.403470
MA(35) 10.408937
MA(7) 10.404365
MA(40) 10.409406
MA(9) 10.405014
MA(45) 10.409813
MA(11) 10.405528
MA(50) 10.410163
MA(13) 10.405958
MA(55) 10.410458
Indicator window 1
RSI(14) 20.76
ANALYSIS BELOW:
Since the RSI value (20.22) is less than the RSI_Oversold_Level (30), the RSI condition for a buy signal is met.
Since all the short-term EMAs are above the long-term EMAs, the long_above_short condition is true, and the short_above_long condition is false.
Based on my analysis, the market data meets the conditions for a buy signal in the code. Therefore, the code should generate a buy signal for the given market data.
Any ideas on where I go from here??