How to test EA for binary options on mt4 strategy tester on one of these brokers :CoreLiquidityMarkets or Grand capital

To add comments, please log in or register
Dimitar Pavlov
1455
Dimitar Pavlov  

Does anyone know how to test EA for binary options on mt4 strategy tester with one of these brokers CoreLiquidityMarkets or Grand capital ( they have binary options based on mt4) ?

Thank you in advance :) 

Trinh Dat
50560
Trinh Dat  
it is not possible. But you can backtest if use virtual orders.
Dimitar Pavlov
1455
Dimitar Pavlov  
Trinh Dat:
it is not possible. But you can backtest if use virtual orders.
Thank you 
David Woolrich
170
David Woolrich  

Hi,

 I had a method to back test my binary option EA by using an expiry time to close the order after a time I specified. I did this using Order = SIGNAL_CLOSEBUY or SIGNAL_CLOSESELL.

You have to set the backtest spread to 1 so not a true 0 spread you would get with BO but it can give you an idea. 

 So..

Input Variables 

extern int expirytimelong =         15;
extern int expirytimeshort =        15; 

Variables

int timedifflong =                      expirytimelong * 60; // 60 = 1 mins
int timediffshort =                     expirytimeshort * 60; // 60 = 1 mins 

Closing the Orders

if (TimeCurrent() - OrderOpenTime() > timedifflong) Order = SIGNAL_CLOSEBUY; 

Hope this helps :-)

GoodBo 

Fstrifoerr8
36
Fstrifoerr8  
Dimitar Pavlov:

Does anyone know how to test EA for binary options on mt4 strategy tester with one of these brokers CoreLiquidityMarkets or Grand capital ( they have binary options based on mt4) ?

Thank you in advance :) 

Add this to code. Set on single pair and set tester_close=true 

extern bool tester_close = false;
////////////////////////////////////////////////////////////
void OnTick()
{
...
//tester
if(tester_close) tester_close_f();
...
}

////////////////////////////////////////////////////////////
void tester_close_f()
{
for(int i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i, SELECT_BY_POS))
{
if(OrderMagicNumber()==Magic)
{
if(OrderSymbol()==Symbol())
{
if(TimeCurrent()>=OrderOpenTime()+expir_time*60)
{
bool ticket_ex=false;
for (int j_ex = 0;j_ex < 26; j_ex++)
{
while(IsTradeContextBusy()) Sleep(200);
RefreshRates();
if(OrderType()==OP_BUY ) ticket_ex=OrderClose(OrderTicket(),OrderLots(),Bid,0,clrYellow);
else
if(OrderType()==OP_SELL) ticket_ex=OrderClose(OrderTicket(),OrderLots(),Ask,0,clrYellow);
else
ticket_ex=true;

if(ticket_ex==true)break;
}
}//time to close
}
}
}
}



}

 


 

Fstrifoerr8
36
Fstrifoerr8  
Trinh Dat:
it is not possible. But you can backtest if use virtual orders.
It is a pity that you code programms to people.
Trinh Dat
50560
Trinh Dat  

Your code is useless. have not resutl of trategy.

below is result if use virtual order and write to file.


Fstrifoerr8:
It is a pity that you code programms to people.
Fstrifoerr8:

Add this to code. Set on single pair and set tester_close=true 

extern bool tester_close = false;
////////////////////////////////////////////////////////////
void OnTick()
{
...
//tester
if(tester_close) tester_close_f();
...
}

////////////////////////////////////////////////////////////
void tester_close_f()
{
for(int i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i, SELECT_BY_POS))
{
if(OrderMagicNumber()==Magic)
{
if(OrderSymbol()==Symbol())
{
if(TimeCurrent()>=OrderOpenTime()+expir_time*60)
{
bool ticket_ex=false;
for (int j_ex = 0;j_ex < 26; j_ex++)
{
while(IsTradeContextBusy()) Sleep(200);
RefreshRates();
if(OrderType()==OP_BUY ) ticket_ex=OrderClose(OrderTicket(),OrderLots(),Bid,0,clrYellow);
else
if(OrderType()==OP_SELL) ticket_ex=OrderClose(OrderTicket(),OrderLots(),Ask,0,clrYellow);
else
ticket_ex=true;

if(ticket_ex==true)break;
}
}//time to close
}
}
}
}



}

 


 

Fstrifoerr8
36
Fstrifoerr8  
Trinh Dat:

Your code is useless. have not resutl of trategy.

below is result if use virtual order and write to file.


It is doubled pity that you are write code to people.
Keith Watford
Moderator
24134
Keith Watford  
Comments that do not relate to this topic, have been moved to "Off Topic Posts".
To add comments, please log in or register