Dear all,
I tried to setup a one trade per day strategy on a 5 minute chart but it does not work.
I followed some tutorials from this tutorial and uses the oneTrade variable to keep track of trading history.
if I remove the IF statement at line 84, pro-backtest will have several trades on a certain day.
However, no trades are made if the condition at line 84 is kept there.
Any ideas?
WimParticipant
Junior
Try dropping the part (minute=15….) for starters. You have already forced the timeframe to M15, no need to check whether minute=n*15. And moreover, all calculations are made for the values at the end of a candle, and the end of the 10:15 candle is 10:30 etc.
Please post the code, not a screenshot of it, so that it can be used. Thanks 🙂
I suggest that you add this line (as line 77 or 82):
OTD = Barindex - TradeIndex(1) > IntradayBarIndex
then replace the condition OneTrade = 0 by OTD (or OTD = 1) in line 84.