Hi! I wanted to ask if someone can 'spot' me and double check if my logic is correct with regards to using a RSI to spot a market reversal by means of a using a 1minute RSI with a 14 period value. Is there any room for improvement for better accuracy?
if(structTimeEndSession.day_of_week > 0 && structTimeEndSession.day_of_week < 6) { if(RSIResultOne == 1 && LowerLow && BuyPrice < OpenPrice && BuyPrice < OpenPriceTwelveHour && BuyPrice < OpenPriceEightHour && BuyPrice < OpenPriceSixHour && BuyPrice < OpenPriceFourHour && BuyPrice < OpenPriceThreeHour && BuyPrice < OpenPriceTwoHour && BuyPrice < OpenPriceOneHour && BuyPrice < OpenPriceThirtyMinutes && BuyPrice < OpenPriceTwentyMinutes && BuyPrice < OpenPriceFifteenMinutes && BuyPrice < OpenPriceTwelveMinutes && BuyPrice < OpenPriceTenMinutes && BuyPrice < OpenPriceSixMinutes && BuyPrice < OpenPriceFiveMinutes && BuyPrice < OpenPriceFourMinutes && BuyPrice < OpenPriceThreeMinutes && BuyPrice < OpenPriceTwoMinutes && BuyPrice < OpenPriceOneMinute) { static datetime prevTime=0; datetime lastTime[1]; if(CopyTime(_Symbol,PERIOD_D1,0,1,lastTime)==1 && prevTime!=lastTime[0]) { prevTime=lastTime[0]; trade.SetExpertMagicNumber(MagicNumber); double EnterLong = SymbolInfoDouble(_Symbol,SYMBOL_ASK); EnterLong = NormalizeDouble(EnterLong,_Digits); trade.Buy(Lots,_Symbol,EnterLong,NULL,NULL,"Enter Long"); } } } if(structTimeEndSession.day_of_week > 0 && structTimeEndSession.day_of_week < 6) { if(RSIResultOne == -1 && HigherHigh && SellPrice > OpenPrice && SellPrice > OpenPriceTwelveHour && SellPrice > OpenPriceEightHour && SellPrice > OpenPriceSixHour && SellPrice > OpenPriceFourHour && SellPrice > OpenPriceThreeHour && SellPrice > OpenPriceTwoHour && SellPrice > OpenPriceOneHour && SellPrice > OpenPriceThirtyMinutes && SellPrice > OpenPriceTwentyMinutes && SellPrice > OpenPriceFifteenMinutes && SellPrice > OpenPriceTwelveMinutes && SellPrice > OpenPriceTenMinutes && SellPrice > OpenPriceSixMinutes && SellPrice > OpenPriceFiveMinutes && SellPrice > OpenPriceFourMinutes && SellPrice > OpenPriceThreeMinutes && SellPrice > OpenPriceTwoMinutes && SellPrice > OpenPriceOneMinute) { static datetime prevTime=0; datetime lastTime[1]; if(CopyTime(_Symbol,PERIOD_D1,0,1,lastTime)==1 && prevTime!=lastTime[0]) { prevTime=lastTime[0]; trade.SetExpertMagicNumber(MagicNumber); double EnterShort = SymbolInfoDouble(_Symbol,SYMBOL_BID); EnterShort = NormalizeDouble(EnterShort,_Digits); trade.Sell(Lots,_Symbol,EnterShort,NULL,NULL,"Enter Short"); } } } }
I forgot to add this in too, this is where the final conditional would be before submission.
It seems you are using MT5. I strongely unrecommend to use iClose, iOpen etc.
Use MqlRates structure and CopyRates command, this will not only make your code more efficient and reliable, but also readable, which at the moment it's very far from...
Thanks for the advice. How does functionality differ between Mql rates and the iOpen, iClose, iLow, iHigh functions in terms of efficency?
Thanks for the advice. How does functionality differ between Mql rates and the iOpen, iClose, iLow, iHigh functions in terms of efficency?

- 2023.07.27
- Ahmed_Fouda
- www.mql5.com
IYO is the data synchronization issue with iOHLC shit on all time frames or mostly on the smaller, 'more active' time frame ie 1 min, 2 min, 3 min etc?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi! I wanted to ask if someone can 'spot' me and double check if my logic is correct with regards to using a RSI to spot a market reversal by means of a using a 1minute RSI with a 14 period value. Is there any room for improvement for better accuracy?