Hi
I need to create a script that when my system time hits a certain time of the day a automatic buy or sell order needs to be placed. I figured out the system time thing, but I'm struggling to do the following for the buy / sell:
if the current bar is higher than 12 bars back then the ticket must sell.
if the current bar is lower than 12 bars back the ticket must buy.
- Flexible MetaTrader 5 trading system with all order types
- Web version features
- MetaTrader Market - the largest store of trading applications
dumb_07070:
Hi
I need to create a script that when my system time hits a certain time of the day a automatic buy or sell order needs to be placed. I figured out the system time thing, but I'm struggling to do the following for the buy / sell:
if the current bar is higher than 12 bars back then the ticket must sell.
if the current bar is lower than 12 bars back the ticket must buy.
Hi
if ( High[0] > High[12] ) { // Sell code goes here } else if ( Low[0] < Low[12] ) { // Buy code goes here }
Filter:
Hi
Hi
Looks good, I will give it a run and see, thanks :)
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