This is not accurate when I put 3600, which means that he should not open more than four trades on the four-hour chart, but he opens more than one trade in an hour sometimes.
Sebhy Kl #: This is not accurate when I put 3600, which means that he should not open more than four trades on the four-hour chart, but he opens more than one trade in an hour sometimes.
My problem is that my Expertty succeeds when I run it in Control Point mode
But it fails when I turn it on Every tick mode
I concluded that the difference between them is only that the control point setting delays about seconds or minutes between executing the deals, so I am trying to find a function that sets a period between opening the deals and it works on the backtest and the real account
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
thank you
onewithzachy
Thank you very much from the heart. I was facing that the sleep function did not work with your last function. Now it working on the backtest,
but inside it it takes a variable of the type of int only, and I want to be delayed in hours or seconds.
What is the solution in your opinion?
onTick(){ static datetime sleepTime=0; datetime now = TimeCurrent(); if(now < sleepTime) return; ⋮ sleepTime = now + seconds; // Minutes*60 hours*3600; }William Roeder #
thanks
This is not accurate when I put 3600, which means that he should not open more than four trades on the four-hour chart, but he opens more than one trade in an hour sometimes.
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We can't see your broken code.
William Roeder
William Roeder#
I made this code but it didn't work for delaying time between trades
uint now = GetTickCount();
long orderticktime ;
if (orderticktime <= now)
{
if(OrderSelect (0,1,OP_BUY)){
orderticktime = GetTickCount()+10000; // Ms + 10 Minuts
}
.
.
.
}
Please edit your post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor