Hi Pros,
With futures I have extreme spreads at the end of the trading day and at the start of the trading day.
Crazy ticks - spreads of 50 points and more.
So i have learned that i can manage my EA to work at different times...
But how can i secure existing orders (stop los, limit orders) not to execute.
I have good spreads the whole day. I just don‘t want to get the Ticks in the last trading minute and in the first trading minute of the day.
I want to block them completely. Is there a easy setting?
others could have different approach..but this is practical to me.
input int _SecondsBeforeTradeOpen = 900; input int _SecondsBeforeTradeClose = 3600; input bool _EnableScheduledTrade = true; int _SafeTradeOpenHour = 0; int _SafeTradeOpenMinute = 0; int _SafeTradeCloseHour = 0; int _SafeTradeCloseMinute = 0; int _StartTradeAfter = 0; int _EndTradeBefore = 0; bool _SafeTradeTime = false; void _InSafeTradeTime() { datetime _LastD1Open = iTime(_Symbol,PERIOD_D1,1) + _SecondsBeforeTradeOpen; MqlDateTime _D1Open; TimeToStruct(_LastD1Open,_D1Open); //--- assuming 1 hour before we should avoid open any position and close position datetime _LastD1Close = _LastD1Open - _SecondsBeforeTradeClose; MqlDateTime _D1Close; TimeToStruct(_LastD1Close,_D1Close); _SafeTradeOpenHour = _D1Open.hour; _SafeTradeOpenMinute = _D1Open.min; _SafeTradeCloseHour = _D1Close.hour; _SafeTradeCloseMinute = _D1Close.min; _StartTradeAfter = int(_SafeTradeOpenHour*3600)+int(_SafeTradeOpenMinute*60); _EndTradeBefore = int(_SafeTradeCloseHour*3600)+int(_SafeTradeCloseMinute*60); datetime _TimeOfDay = TimeCurrent(); MqlDateTime _NowTime; TimeToStruct(_TimeOfDay,_NowTime); int _CurrrentHour = int(_NowTime.hour * 3600); int _CurrentMinute = int(_NowTime.min * 60); int _RunningSeconds = _CurrrentHour+_CurrentMinute; if (_RunningSeconds>=_StartTradeAfter&&_RunningSeconds<_EndTradeBefore) { if (!_EnableScheduledTrade) { _SafeTradeTime = false; return; } _SafeTradeTime = true; return; } _SafeTradeTime = false; return; }
- www.mql5.com
With futures I have extreme spreads at the end of the trading day and at the start of the trading day.
Crazy ticks - spreads of 50 points and more.
But how can i secure existing orders (stop los, limit orders) not to execute.
I want to block them completely. Is there a easy setting?
- You can't block them because they are real. There are no settings, it's the market. Learn to deal with it.
- On FX most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134.
- With my indicator I maintain my own maximum spread using a power mean.
Can I find out the biggest spread at the past in MT4? - MQL4 programming forum - Page 2 #14 20.04.15
Thanks for your replies.
Then it is, as i thought.
Probably i go to delete and renew the same order after all conditions are green.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Pros,
With futures I have extreme spreads at the end of the trading day and at the start of the trading day.
Crazy ticks - spreads of 50 points and more.
So i have learned that i can manage my EA to work at different times...
But how can i secure existing orders (stop los, limit orders) not to execute.
I have good spreads the whole day. I just don‘t want to get the Ticks in the last trading minute and in the first trading minute of the day.
I want to block them completely. Is there a easy setting?