Hi all,
I require some help to program a script for MB Trading MT4 platform. But unfortunately my programming sucks big time.
The codes below was extracted from one of the MBT forums for MT4. Basically the code is a 2 step process:
(1) Instant market Execution
(2) Then modifying the SL and TP because MBT MT4 platform will not accept TP and SL.
Many thanks in advance !!
//---Making a Buy Trade
if(active_trades < 1 && ok_2_buyc == 1 && ((move_ave0 >= Open[0] && move_ave0 <= Close[0]) || (move_ave0 >= Open[1] && move_ave0 <= Close[1])) && cci_buy == 1 && Open[1] < Close[1] && force_1 > force_3)
{
ticket=OrderSend(Symbol(),OP_BUY,1.0,NormalizeDoub le(Ask,5),3,0,0,"for giggles",858101,0,Green);
Sleep(200);
OrderSelect(ticket, SELECT_BY_TICKET);
OrderModify(ticket,OrderOpenPrice(),NormalizeDoubl e(OrderOpenPrice()- stop_loss*Point,5),NormalizeDouble(OrderOpenPrice( )+ take_profit*Point,5),0,CLR_NONE);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))Print(" BUY order : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
Print("cci buy is : ",cci_buy," cci sell is : ",cci_sell," cci short sell is: ",short_sell," cci short buy is: ",short_buy);
active_trades = 1;
return(0);
}
I require some help to program a script for MB Trading MT4 platform. But unfortunately my programming sucks big time.
The codes below was extracted from one of the MBT forums for MT4. Basically the code is a 2 step process:
(1) Instant market Execution
(2) Then modifying the SL and TP because MBT MT4 platform will not accept TP and SL.
Many thanks in advance !!
//---Making a Buy Trade
if(active_trades < 1 && ok_2_buyc == 1 && ((move_ave0 >= Open[0] && move_ave0 <= Close[0]) || (move_ave0 >= Open[1] && move_ave0 <= Close[1])) && cci_buy == 1 && Open[1] < Close[1] && force_1 > force_3)
{
ticket=OrderSend(Symbol(),OP_BUY,1.0,NormalizeDoub le(Ask,5),3,0,0,"for giggles",858101,0,Green);
Sleep(200);
OrderSelect(ticket, SELECT_BY_TICKET);
OrderModify(ticket,OrderOpenPrice(),NormalizeDoubl e(OrderOpenPrice()- stop_loss*Point,5),NormalizeDouble(OrderOpenPrice( )+ take_profit*Point,5),0,CLR_NONE);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))Print(" BUY order : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
Print("cci buy is : ",cci_buy," cci sell is : ",cci_sell," cci short sell is: ",short_sell," cci short buy is: ",short_buy);
active_trades = 1;
return(0);
}