I'm making an EA that makes pending orders for breakout strategies. However during backtesting orders couldn't be sent. It kept displaying the following 3 errors:
"OrderSend error 130"
"OrderSend error 4107" but I'd already allowed dll imports
and
"invalid takeprofit for OrderSend Function"
I've tested and checked it many times, still couldn't manage to fix it.
I am using MT4 from GoMarkets which does not set limits on placing buystop, sellstop, stoploss and takeprofit
Could anyone please help me?
One strange thing was that I'd tried to print the values of "high" and "low" and the outcome were both 5-digit while the mt4 itself is a 6-digit one. I don't know whether this has anything to deal with the errors.
"OrderSend error 130"
"OrderSend error 4107" but I'd already allowed dll imports
and
"invalid takeprofit for OrderSend Function"
I've tested and checked it many times, still couldn't manage to fix it.
I am using MT4 from GoMarkets which does not set limits on placing buystop, sellstop, stoploss and takeprofit
Could anyone please help me?
PHP Code
int CurrentTime = Hour()*100 + Minute();
double high = High[iHighest(0,0,MODE_HIGH,8,1)];
double low = Low[iLowest(0,0,MODE_LOW,8,1)];
if (CurrentTime >= start || CurrentTime < end)
{
if(GateB==0)
{
Buy=OrderSend(Symbol( ) ,OP_BUYSTOP,Lots,high,Slip,low,high+Point*TakeProfit,"",0,0,Blue);
GateB=1;
}
}