Hello,
I’d like to programm the following strategy:
1.) If the current H1 bar is in the last half min and the current price is higher than the current bars open + the current bars range * 0.8 then the robot should buy.
a.)My first problem is that in the strategy tester no matter what period I set it test just from 2012 jul. 05. So I can set a year or any period it test just from jul. 05…
Is there anybody met this problem before?
b.)The second question is that I checked all the opens and closes on the chart and mostly the close was fine but sometimes the condition where all true but it doesnt close the open orders just some bars later or never. Is there a problem with my close method or what can be the problem?
1. What if there are no ticks in the last 30 seconds of the hour ?
a. you need to get data to cover the period you want to test, use the search on this page top right and you will find sources of data.
b. when closing/deleting orders your loop must count down: Loops and Closing or Deleting Orders
1. What if there are no ticks in the last 30 seconds of the hour ?
a. you need to get data to cover the period you want to test, use the search on this page top right and you will find sources of data.
b. when closing/deleting orders your loop must count down: Loops and Closing or Deleting Orders
1. If there are no ticks it is not important I think because there will be no open and the condition of close contains that OrderTotal()>0.
But yes I miss some oportuniy in backtesting.
a. Thanks I found a topic about historical data download.
b. Thanks now I got the difference that article was very usefull !
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I’d like to programming the following strategy:
1.) If the current H1 bar is in the last half min and the current price is higher than the current bars open + the current bars range * 0.8 then the robot should buy.
2.) The stop is the current bars low.
3.) If the robot bought on the previous bar and the current price (in this case the current means the previous if we compare to the 1.) part’s bar) is higher than the previous bars close then the robot should close the open positions.
a.)My first problem is that in the strategy tester no matter what period I set it test just from 2012 jul. 05. So I can set a year or any period it test just from jul. 05…
Is there anybody met this problem before?
b.)The second question is that I checked all the opens and closes on the chart and mostly the close was fine but sometimes the condition where all true but it doesnt close the open orders just some bars later or never. Is there a problem with my close method or what can be the problem?
Hope I was clear and understandable.
Thanks,
David