I cannot spot TIMEFRAME(Daily) in your code?
You didn’t tell us many details, what was the TF on your chart? I must assume there’s no DAILI TF because you launched your strategy from a DAILY chart, which is not correct!
The TF on chart, also called main or default TF, is the one that rules and MUST be the smallest one used! BariIndex, TradeIndex,… are all referring to that TF. All other TF’s used in your strategy MUST be multiple of the main one!
To recap, you have to launch your strategy from a 1-minute chart (the default or main TF as I already said). In your strategy you can use any additional TF provided it is a multiple of that main one!
In your case you launched your strategy from a DAILY chart, but 1 minute is NOT a multiple of a DAY (it’s the other way round). From a daily chart you can launch a strategy that uses Daily, Weekly or Monthly TF!
You will have to launch your strategy from a 1-minute chart (and you will have much less data history available!).
2 users thanked author for this post.