Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
- You are trying to differentiate M5 from M15 orders. You need two Magic number for that.
- Count the number of orders (per TF) before opening.
Hi,
what do you think about a simple counter, which will be reseted every new hour:
int HourCount = 0; ... void OnTick() { datetime ServerTime = (datetime) MarketInfo(Symbol(), MODE_TIME); if ((TimeMinute(ServerTime) == 0) && (TimeSeconds(ServerTime) == 0)) HourCount = 0; ... if (HourCount < 4) { OrderSend(); HourCount++; }
Best regards
William Roeder:
- You are trying to differentiate M5 from M15 orders. You need two Magic number for that.
- Count the number of orders (per TF) before opening.
Using seprate Magic number for each condition.
Counting order number seprately with bool.
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
Hi ,
I need help , badly stuck in maximum order stuff. Crawled a lot on web but didnt find the solution.
The thing is , My code have 2 condition with M5 & M15 , both should open buy/sell or both at a time.
So M5 buy/sell , M15 buy/sell : Total orders is 4 per H1 candle
If i select order with magic number & add below code , then I will get only 1 order per candle instead of max 4 orders.