Loading...
Continue to Myfxbook.com
Continue to Myfxbook.com
Pieslēgties
Sign Up
Open an account with FOREX.com
FX Tools:
Ekonomisko notikumu kalendārs
Interest Rates
FX Calculators
News
spreads
Apskats
Forex Heat Map
Correlation
Market Hours
Sākumlapa
Kopiena
Programmēšana
Random sleep
Share
Share this page!
Edit Your Comment
Random sleep
Abonēts
Lugevho17
Jun 01, 2016 at 06:25
432 Views
2 Replies
Lugevho17
Biedrs kopš
25 ieraksti
Jun 01, 2016 at 06:25
Biedrs kopš
25 ieraksti
Hello,
I try to code a random sleep time before opening each trade to avoid opening 2 trades simultaneously when my EA is on multiples charts.
If(OrdersTotal()==0 && condition for buy) {
((Randon sleep here)) //open the trade wich has lowest sleep first, then OrdersTotal()==1, avoid 2nd trade to open.
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,'Trend',1000,0,Green);
}
Could someone help ma please?
Thank you
luclevesque17@
forex_trader_25447
Biedrs kopš
131 ieraksti
Jun 01, 2016 at 08:47
Biedrs kopš
131 ieraksti
You can use 'GlobalVariable' :
https://docs.mql4.com/globals
When some EA send order, this variable accept the time of execution.
Each EA can make anything, only after N seconds (and again set this variable).
It is also useful to check IsTradeContextBusy() before execution,
it is possible some EA is already working.
Lugevho17
Biedrs kopš
25 ieraksti
Jun 03, 2016 at 08:14
Biedrs kopš
25 ieraksti
Thank you Yvan. I will try with IsTradeContextBusy()
luclevesque17@
Pieslēgties
/
Sign Up
to comment
You must be connected to Myfxbook in order to leave a comment
😄
😐
😡
😁
😀
😑
😈
😲
😭
😎
😝
😳
😕
🙄
😞
🙃
😱
😇
😉
😂
*Spams netiks pieļauts, un tā rezultātā var slēgt kontu.
Tip: Posting an image/youtube url will automatically embed it in your post!
Tip: Type the @ sign to auto complete a username participating in this discussion.
You have an Ad Blocker!
Myfxbook is a site supported by advertisements. Here are two ways for you to continue browsing:
Ad Free Subscription
or
Disable your Ad Blocker
Already subscribed?
Pieslēgties
You're not logged in
This feature is available for registered members only.
Registration is free and takes less than a minute.
Click the sign up button to continue.
Unless you're already a member and enjoying our service, then just sign in.
Keep up to date with the markets
Enable notifications to receive real-time important market updates:
Ekonomisko notikumu kalendārs
Forex ziņas
You can disable notifications at any time from your browser.
Unblock Notifications
You've blocked browser notifications for Myfxbook.com. Please enable it:
You can disable notifications at any time from your browser.
IEPRIEKŠĒJĀS
VIENPRĀTĪBA
AKTUĀLS