Function IsTradeAllowed now accepts two parameters. Undocumented. Does anybody know the meaning of the two params?
How did you know it? Can you show us how did you find that?
I guess from here:
I guess from here:
I guess from here:
And this is from where?
Entering name of the function into the mql editor.
Ahh - ok, I see.
Have you already played around with this feature?
A Forex-Symbol wouldn't make sense but what about a Share-Index (e.g. DAX) 'outside and insinde' its trading times?
I have created an indicator that will tell me tomorrow:
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- Comment(TimeToStr(TimeGMT(),TIME_DATE| TIME_MINUTES),"\n", Symbol()," isTrdAllowd: ",IsTradeAllowed(Symbol(),TimeGMT())," normal Forex\n", ".DE30Cash isTrdAllowd: ",IsTradeAllowed(".DE30Cash",TimeGMT())," DAX\n", ".DE30CashXE isTrdAllowd: ",IsTradeAllowed(".DE30CashXE",TimeGMT()), " DAX Xetra Trading Hours (9:00.17:30 Ffm == 7:00-15:30 GMT now!)\n" ); //--- return value of prev_calculated for next call return(rates_total); }
Interesting!
The forex market just opened and IsTradeAllowed (see the code above of my indicator) still shows false ?? (Server has GMT as well!)
OK, as it could be that the problem is the indicator - must not trade I mad a dummy-EA:
void OnTick() { Comment("GMT: ",TimeToStr(TimeGMT(),TIME_DATE| TIME_MINUTES),"\n", "Just empty isTrdAllowd: ",IsTradeAllowed(),"\n", Symbol()," isTrdAllowd: ",IsTradeAllowed(Symbol(),TimeGMT())," normal Forex\n", ".DE30Cash isTrdAllowd: ",IsTradeAllowed(".DE30Cash",TimeGMT())," DAX\n", ".DE30CashXE isTrdAllowd: ",IsTradeAllowed(".DE30CashXE",TimeGMT()), " DAX Xetra Trading Hours (9:00.17:30 Ffm == 7:00-15:30 GMT now!)\n" ); }
But I get the same result:
Not implemented yet I guess :(
Wow! Now the second line changes to true:
I change my dummy to:
string dax1="\n.",dax2="\n:"; void OnTick() { if ( dax1=="\n." && IsTradeAllowed(".DE30Cash",TimeGMT()) ) dax1 = "\n.DE30Cash changes to TRUE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); if ( dax2=="\n:" && IsTradeAllowed(".DE30CashXE",TimeGMT()) ) dax2 = "\n.DE30CashXE changes to TRUE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); Comment("GMT: ",TimeToStr(TimeGMT(),TIME_DATE| TIME_MINUTES),"\n", "Just empty isTrdAllowd: ",IsTradeAllowed(),"\n", Symbol()," isTrdAllowd: ",IsTradeAllowed(Symbol(),TimeGMT())," normal Forex\n", ".DE30Cash isTrdAllowd: ",IsTradeAllowed(".DE30Cash",TimeGMT())," DAX\n", ".DE30CashXE isTrdAllowd: ",IsTradeAllowed(".DE30CashXE",TimeGMT()), " DAX Xetra Trading Hours (9:00.17:30 Ffm == 7:00-15:30 GMT now!)", dax1,dax2 ); }
For other to check themselves I changed my code a bit:
string dax1,dax2; void OnTick() { if ( StringFind(dax1,"TRUE @")<0 && IsTradeAllowed(".DE30Cash",TimeGMT()) ) dax1 = "\n.DE30Cash changes to TRUE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); else if ( StringFind(dax1,"FALSE @")<0 && !IsTradeAllowed(".DE30Cash",TimeGMT()) ) dax1 = "\n.DE30Cash changes to FALSE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); if ( StringFind(dax2,"TRUE @")<0 && IsTradeAllowed(".DE30CashXE",TimeGMT()) ) dax2 = "\n.DE30CashXE changes to TRUE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); else if ( StringFind(dax2,"FALSE @")<0 && !IsTradeAllowed(".DE30CashXE",TimeGMT())) dax2 = "\n.DE30CashXE changes to FALSE @ "+TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS); Comment("GMT: ",TimeToStr(TimeGMT(),TIME_DATE|TIME_SECONDS),"\n", "Just empty isTrdAllowd: ",IsTradeAllowed(),"\n", Symbol()," isTrdAllowd: ",IsTradeAllowed(Symbol(),TimeGMT())," normal Forex\n", ".DE30Cash isTrdAllowd: ",IsTradeAllowed(".DE30Cash",TimeGMT())," DAX\n", ".DE30CashXE isTrdAllowd: ",IsTradeAllowed(".DE30CashXE",TimeGMT()), " DAX Xetra Trading Hours (9:00.17:30 Ffm == 7:00-15:30 GMT now!)", dax1,dax2 ); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Function IsTradeAllowed now accepts two parameters. Undocumented. Does anybody know the meaning of the two params?