Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 291

 
tara:

No, it's cool. It's just that the product you're using has not only "features" but also settings that not even the author thought to delve into:) This product is something of a joke that you've researched quite seriously - kudos to you.

By product do you mean a tester?

But I have tested several pairs..... and the result is the same.

 
solnce600:

I'm not quite sure what settings you're talking about, but the code is primitive with a few lines that are just repeated many times

One difficult condition and an order to open an order.


By product do you mean tester?

No, the author called it a tester grail, if I'm not mistaken.
 

I get the hint.

But I realise that the tester and real trading are slightly different things....

But I think they have more similarities than differences.

 
solnce600:

I get the hint.

But I realise that the tester and real trading are slightly different things....

But I think they have more similarities than differences.


You can't beat the felt-tip of the pen for taste and colour.
 
tara:

You can't beat the colour and taste of the felt-tip tester.

What is your opinion, in terms of test quality, of this tester

http://clip2net.com/s/6h6sCw

Is it far superior to the MT-4 tester in terms of testing quality?

Thank you.

 
90909solnce600:

What is your opinion, in terms of test quality, of this tester

http://clip2net.com/s/6h6sCw

Is it much superior to the MT-4 tester in terms of testing quality?

Thank you.



I don't really understand testing quality and would prefer a tester that provides repeatable results with unchanged data (MT4 tester works differently). And therefore I quite often test trading tactics within my own program.
 
tara:

I don't really understand testing quality and would prefer a tester that provides repeatable results with unchanged data (MT4 tester works differently). And therefore I quite often test trading tactics within my own program.
Understood. Thank you.
 

Guys, can someone please describe what is going on and show the place where orders are closing in the +, and opening a new series.

extern bool test=false;  // откл объектов при тесте
extern int prof=56;     // уровень профита
extern int chag=36;     // шаг между ордерами
extern int risk=4;         //уровень риска
extern double lot = 0.01; // начальный лот
extern double k_lot=1.7; // увеличение объема
extern double lot_max=100; // максимальный лот
int kn=9;  // величина вертикальной шкалы
int magic = 37641; 
 
int k,c,b_ind,s_ind,objtot,er;
double buy_prs,sel_prs,buy_ind,sel_ind,or_bu,or_sl,prf_b,prf_s,b_pr,s_pr,b2_cls,s2_cls;
string nh;
int init()
  {
//----
 
if(Digits==2) k=1;
if(Digits==3) k=10;
if(Digits==4) k=1;
if(Digits==5) k=10;
nh=StringSubstr(Symbol(),2,2);
 
 if(!IsTesting()){
    buy_prs=GlobalVariableGet(nh+"_buy_prs"); buy_ind=GlobalVariableGet(nh+"_buy_ind");
    sel_prs=GlobalVariableGet(nh+"_sel_prs"); sel_ind=GlobalVariableGet(nh+"_sel_ind");}
 
c=0;
chag=chag*k;
prof=prof*k;
//нннннннннннннннннннннннннннн//
   return(0);
  }
//============================================//
int start()
  {
//----
int i,y,tick_s,tick_b,tick_slm,tick_blm;
double prov,price_b,price_s,prof_b,prof_s,lot_b,lot_s,b_cls,s_cls,abc;
bool mod_b=false,mod_s=false;

   if(Bars-c>1) c=0;
   i=Bars-c; c=Bars;
 if(!IsTesting()){for(y=0;y<OrdersTotal();y++)
   {OrderSelect(y,0,0); if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=magic||(OrderType()!=0&&OrderType()!=1)) continue;
      prov=prov+OrderProfit()+OrderSwap()+OrderCommission();}
   if(prov<0&&prov<GlobalVariableGet(nh+"_max_prov"))GlobalVariableSet(nh+"_max_prov",prov);}
 
    for (y=0;y<OrdersTotal();y++){OrderSelect(y,0);
      if(Symbol()!=OrderSymbol()||OrderMagicNumber()!=magic) continue; 
      if (OrderType() == 0 || OrderType() == 1) abc=abc + OrderProfit() + OrderSwap() + OrderCommission();
     
      if(OrderType()==0){if(prf_b!=OrderTakeProfit() && prf_b!=0) mod_b=true; prf_b=OrderTakeProfit();}
      if(OrderType()==OP_BUY && tick_b<OrderTicket()) {
       tick_b=OrderTicket();
       price_b=OrderOpenPrice();
       lot_b=OrderLots();
       prof_b=OrderTakeProfit();}
 
      if(OrderType()==1){if(prf_s!=OrderTakeProfit() && prf_s!=0) mod_s=true; prf_s=OrderTakeProfit();}      
      if(OrderType()==OP_SELL && tick_s<OrderTicket()) {
       tick_s=OrderTicket();
       price_s=OrderOpenPrice();
       lot_s=OrderLots();
       prof_s=OrderTakeProfit();} 
 
      if (OrderType()==OP_BUYLIMIT)  tick_blm = OrderTicket();
      if (OrderType()==OP_SELLLIMIT) tick_slm = OrderTicket();}
   if(Ask>buy_prs && or_bu<=0) {buy_prs=Ask; buy_ind=Ask;}
   if((Ask<buy_prs && Ask<buy_ind) || buy_ind==0) buy_ind=Ask;
   b_cls=buy_ind+MathFloor(prof+chag/2)*Point;
   or_bu=MathFloor((buy_prs-buy_ind)/Point/chag); 
   if(Bid>=b_cls && or_bu>0){buy_prs=Ask; buy_ind=Ask; or_bu=0;}
   if(tick_b==0 && b_ind>0){buy_prs=Ask; buy_ind=Ask; or_bu=0;}
 
   if((Bid<sel_prs||sel_prs==0) && or_sl<=0) {sel_prs=Bid; sel_ind=Bid;}
   if(Bid>sel_prs && Bid>sel_ind) sel_ind=Bid;
   s_cls=sel_ind-MathFloor(prof+chag/2)*Point;
   or_sl=MathFloor((sel_ind-sel_prs)/Point/chag);
   if(Ask<=s_cls && or_sl>0){sel_prs=Bid; sel_ind=Bid; or_sl=0;}
   if(tick_s==0 && s_ind>0) {sel_prs=Bid; sel_ind=Bid; or_sl=0;}
 
 if(!IsTesting()){
   GlobalVariableSet(nh+"_buy_prs",buy_prs); GlobalVariableSet(nh+"_buy_ind",buy_ind);
   GlobalVariableSet(nh+"_sel_prs",sel_prs); GlobalVariableSet(nh+"_sel_ind",sel_ind);} 
   if(tick_b==0 && tick_blm!=0) OrderDelete(tick_blm);
   if(tick_s==0 && tick_slm!=0) OrderDelete(tick_slm);
 
   if(or_bu==risk && tick_b==0) open(0); 
   if(or_sl==risk && tick_s==0) open(1);
 
   if(tick_b>0 && tick_blm==0 && lot_b*k_lot<lot_max && Ask>price_b-chag*Point) open_lim(2,price_b,lot_b);
   if(tick_s>0 && tick_slm==0 && lot_s*k_lot<lot_max && Bid<price_s+chag*Point) open_lim(3,price_s,lot_s);
 
   if(mod_b) modif(0,prof_b);
   if(mod_s) modif(1,prof_s);
//===============================
  b_ind=tick_b;   s_ind=tick_s; 
//=================================================//
 if(!test){if(b_pr!=buy_prs || s_pr!=sel_prs || i>=1 || objtot!=ObjectsTotal())
         object(buy_prs,buy_prs-chag*kn*Point, sel_prs,sel_prs+chag*kn*Point);
//======= 
 if(b_cls>buy_prs && ObjectFind("clsbuy")==0) ObjectDelete("clsbuy"); 
 if(s_cls<sel_prs && ObjectFind("clsel")==0)  ObjectDelete("clsel");
 
 if(b_cls<buy_prs && (b2_cls!=b_cls || i>=1 || objtot!=ObjectsTotal())) cls(0,b_cls);
 if(s_cls>sel_prs && (s2_cls!=s_cls || i>=1 || objtot!=ObjectsTotal())) cls(1,s_cls);
 
   b2_cls=b_cls; s2_cls=s_cls;
   b_pr=buy_prs; s_pr=sel_prs;
   objtot=ObjectsTotal(); com(abc);}
//======================================================//
   return(0);
  }
//нннннннннннннннннннннннннннн//
//==================================//
int open(int tip){int tk;
   if(tip==0){tk=OrderSend(Symbol(),OP_BUY,lot,Ask,3,0,0,"martin",magic); er=GetLastError(); if(er>0) err(er);
   if(tk>0){OrderSelect(tk,SELECT_BY_TICKET); OrderModify(OrderTicket(),OrderOpenPrice(),0,OrderOpenPrice()+prof*Point,0);
       er=GetLastError(); if(er>0) err(er);}}
             
   if(tip==1){tk=OrderSend(Symbol(),OP_SELL,lot,Bid,3,0,0,"martin",magic); er=GetLastError(); if(er>0) err(er);    
   if(tk>0){OrderSelect(tk,SELECT_BY_TICKET); OrderModify(OrderTicket(),OrderOpenPrice(),0,OrderOpenPrice()-prof*Point,0);
       er=GetLastError(); if(er>0) err(er);}}}
//==================================//
int open_lim(int tip,double prc,double lota){double lott=NormalizeDouble(lota*k_lot,2); if(lota==0.01 && k_lot>1.3)lott=0.02;
   if(tip==2){OrderSend(Symbol(),OP_BUYLIMIT,lott,prc-chag*Point,3,0,prc-(chag-prof)*Point,"martin",magic,0);
               er=GetLastError(); if(er>0) err(er);}
   if(tip==3){OrderSend(Symbol(),OP_SELLLIMIT,lott,prc+chag*Point,3,0,prc+(chag-prof)*Point,"martin",magic,0);}
               er=GetLastError(); if(er>0) err(er);}
//==================================//
bool modif(int tp,double pf){int y;
   if(tp==0){ for(y=0;y<OrdersTotal();y++){OrderSelect(y,0);
      if(Symbol()!=OrderSymbol() || OrderMagicNumber()!=magic || OrderType()!=0) continue;
       OrderModify(OrderTicket(),OrderOpenPrice(),0,pf,0); er=GetLastError(); if(er>0) err(er);}}
//=======   
   if(tp==1){ for(y=0;y<OrdersTotal();y++){OrderSelect(y,0);
      if(Symbol()!=OrderSymbol() || OrderMagicNumber()!=magic || OrderType()!=1) continue;   
       OrderModify(OrderTicket(),OrderOpenPrice(),0,pf,0); er=GetLastError(); if(er>0) err(er);}}}      
//======================================//
bool com(double abc){Comment("  gubaha martin.    ",TimeToStr(TimeLocal(),4),
      "\n", "  максим. просадка   =  ",GlobalVariableGet(nh+"_max_prov")," $",
      "\n", "  Текущий прибыль= ",NormalizeDouble(abc,2)," $ ", 
      "\n", "  Текущий баланс       = ", AccountBalance(), " $ ");}
//==================================//
bool object(double up_b,double dw_b,double up_s,double dw_s){
   if(ObjectFind("lin_b")==-1)
      {ObjectCreate("lin_b",2,0,Time[0]+Period()*240,up_b,Time[0]+Period()*240,dw_b);
       ObjectSet("lin_b",10,0);ObjectSet("lin_b",6,DeepSkyBlue);
       ObjectSet("lin_b",8,2);}   
   else{ObjectSet("lin_b",1,up_b); ObjectSet("lin_b",0,Time[0]+Period()*240);
        ObjectSet("lin_b",3,dw_b); ObjectSet("lin_b",2,Time[0]+Period()*240);}      
//-------------
   if(ObjectFind("lin_s")==-1)
      {ObjectCreate("lin_s",2,0,Time[0]+Period()*480,up_s,Time[0]+Period()*480,dw_s);
       ObjectSet("lin_s",10,0);ObjectSet("lin_s",6,Red);
       ObjectSet("lin_s",8,2);}   
   else{ObjectSet("lin_s",1,up_s);ObjectSet("lin_s",0,Time[0]+Period()*480);
        ObjectSet("lin_s",3,dw_s);ObjectSet("lin_s",2,Time[0]+Period()*480);}
//-------------
 string ln; int y,tm,tm2,col,shn; double kln;
 
   for(y=0;y<=kn*2+1;y++){ln="kr_"+DoubleToStr(y,0);    
      if(y<=kn){kln=up_b-y*chag*Point; tm=120; tm2=240;}
      if(y>kn && y<=kn*2+1){kln=up_s+(y-kn-1)*chag*Point; tm=360; tm2=480;}
      if(y==risk || y==kn+1+risk) {col=Lime; shn=3;} else {col=DarkGoldenrod; shn=0;}
 
   if(ObjectFind(ln)==-1)   
       {ObjectCreate(ln,2,0,Time[0]+Period()*tm,kln,Time[0]+Period()*tm2,kln);
        ObjectSet(ln,10,0);ObjectSet(ln,6,col); ObjectSet(ln,8,shn);}
   else{ObjectSet(ln,1,kln);ObjectSet(ln,3,kln);ObjectSet(ln,6,col); ObjectSet(ln,8,shn);
        ObjectSet(ln,0,Time[0]+Period()*tm);ObjectSet(ln,2,Time[0]+Period()*tm2);}}}
//==============//
 bool cls(int tp,double clos){
   if(tp==0){if(ObjectFind("clsbuy")==-1) 
       {ObjectCreate("clsbuy",2,0,Time[0]+Period()*120,clos,Time[0]+Period()*240,clos);
        ObjectSet("clsbuy",10,0);ObjectSet("clsbuy",6,Magenta); ObjectSet("clsbuy",8,3);}
   else{ObjectSet("clsbuy",1,clos); ObjectSet("clsbuy",3,clos);   
        ObjectSet("clsbuy",0,Time[0]+Period()*120); ObjectSet("clsbuy",2,Time[0]+Period()*240);}}
 
   if(tp==1){if(ObjectFind("clsel")==-1)      
       {ObjectCreate("clsel",2,0,Time[0]+Period()*360,clos,Time[0]+Period()*480,clos);
        ObjectSet("clsel",10,0); ObjectSet("clsel",6,Magenta); ObjectSet("clsel",8,3);}
   else{ObjectSet("clsel",1,clos); ObjectSet("clsel",3,clos);   
        ObjectSet("clsel",0,Time[0]+Period()*360); ObjectSet("clsel",2,Time[0]+Period()*480);}}
       }
 
Burger:

Can you please tell me why in the Strategy Tester the EA works, but in the demo account, even if I set a small timeframe, the EA just smiles and does not open a position?

beta version.0

extern double Minimal_lot = 1;//values:1;0.10;0.01

extern double Price_item = 10;

extern double Percent_profit = 20;

extern double Percent_risk = 20;

extern datetime time1 = D'24.11.2014 19:00';

extern double price1 = 1.3450;

extern datetime time2 = D'24.11.2014 19:00';

extern double price2 = 1.3560;

extern datetime time_close = D'24.11.2014 19:00:00';//format of time dd.mm.ggg hh:mm:ss

extern int AF = 100;

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

double TP,SL,BBU,BBD,dLTU,dLTD,N;

string comment = NULL;

string LTU,LTD;

int ticket;

int DSL = ((Percent_Risk/100)*AccountBalance());

int DTP = ((Percent_Profit/100)*AccountBalance());

int Times = (Time_close/3600)-(TimeLocal())/3600;

BBU = iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,0);

BBD = iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,0);

N = ((AccountBalance()*(Percent_Risk/100))/(Point_price*AF))*Minimum_lot;

TP = (DSL+((Percent_Risk/100)*Times)/(Point_price*AF*(Percent_profit/100)))/Point_price;

SL = (DTP-((Percent_risk/100)*Times)/(Price_item*AF*(Percent_profit/100)))/Price_item;

if(price1<price2)

{

LTU = ObjectCreate("Trend Up",OBJ_TREND,0,time1,price1,time2);

dLTU = StrToDouble(LTU);

}

if(price1>price2)

{

LTD = ObjectCreate("TrendBack",OBJ_TREND,0,time1,price1,time2,price2);

dLTU = StrToDouble(LTD);

}

//----

if(BBU<dLTU)

{

ticket=OrderSend(Symbol(),OP_SELL,N,Bid,3,Bid+SL*Point,Ask-TP*Point,comment,365,Green);

}

if(Closing time==true)

{

OrderClose(OrderTicket(),OrderLots(),Ask,10);

}

if(BBD>dLTD)

{

ticket=OrderSend(Symbol(),OP_BUY,N,Ask,3,Bid-SL*Point,Ask+TP*Point,comment,367,Green);

}

if(Closing time==true)

{

OrderClose(OrderTicket(),OrderLots(),Bid,10);

}

return(0);


you have the year 2014
 

Guys, please advise a good DC for EA trading?

Reason: