if (!IsTradeAllowed()) { Alert("Please Enable Auto Trading to run this EA"); ExpertRemove(); }
Still getting order send errors though and now get OrderSend Error: 131: Invalid Trade Volume
case 131: return("131: Invalid Trade Volume");
I guess my question is can the OnTick module return before trading if not possible to send an order? like over the weekend?
Just remember to disabled auto trading over the weekends?
It's trying to send a 0.15 lot btw
Ok I think it's working
if( !IsTradeAllowed(Symbol(),Time[0]) ) return;
The time it gives is 2018.06.08 00:00:00 after Friday is over. This time is the beginning of Friday?
And it didn't work like this
if( !IsTradeAllowed() ) return;
It just doesn't seem to be the right usage for prohibiting trading over the weekend
Now I've got OnTick like this
if(!IsConnected() || !IsTradeAllowed(strSymbol,Time[0])){ sStat=" *NO-TICKS*"; EAComment(); return; } //- NO TICKS/STOPPED if(Bars<MA_Period){ sStat=" *NO-BARS*"; EAComment(); return; } //- NO BARS
And it doesn't allow trades over the weekend ..
But about Bars? On Weekly chart theres only 118 bars and it'd not enough to make a 200 period moving average calculation.
So theres bars in chart set to 65000 and then bars in history set to 512000 ...
Bars reads 118 and yet moving average displays
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to use
if live trading is stopped ..
I am trying to use
if the EA is not connected to the broker ...
and on top of that(on a side note)
I am trying to stop EA if there is not enough bars
if I go to weekly chart it says bars is 118.. then how can moving average 200 period even be displayed?
This last one doesn't seem to work appropriately ...
Anyway I get an error from the EA trying to open orders
case 4109: return("Trade Is Not Allowed In The Expert Properties");
Well this doesn't make sense either, because it's the weekend, terminal is connected ...
And I have been reading the CheckUp and getting no where is basically why I seek help