How to add ordersend to Time filter
Could someone please tell me
How to add if false == ordersend();
Although I add these coding, EA still open positions.
you can use this code instead:
input string Time_Start_Hour = 2; input string Time_Start_Minute = 0; input string Time_End_Hour = 21; input string Time_End_Minute = 0; extern bool Filter_TradingTime=true; uchar hour = Hour(); uchar minute = Minute(); void OnTick() { TradingTime(); } bool TradingTime() { if(Filter_TradingTime) { if(hour >= Time_Start_Hour && hour<=Time_End_Hour) return true; else return false; } }
and about orderSend function, it returns an integer value
and when no order opened, it returns -1
you should write such this:
int ticket = OrderSend(); if (ticket <0) or if(ticket ==-1)
Strings are characters. In MQL5 they are Unicode. This type of comparison is considered inconsistent.
you can use this code instead:
and about orderSend function, it returns an integer value
and when no order opened, it returns -1
you should write such this:
Strings are characters. In MQL5 they are Unicode. This type of comparison is considered inconsistent.
Thank you for the advice
Could someone please tell me
How to add if false == ordersend();
Although I add these coding, EA still open positions.