You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. I put N7S_AO_772012_M1 in C:\Program Files\MetaTrader - Alpari\experts. Have I done it correctly?
2. iCus_N7S_TSM_forExp I put it to C:Program Files\MetaTrader - Alpari\experts\indicators. Did I do it correctly?
Do I need to perform some settings in the terminal to make N7S_AO_772012_M1 work with iCus_N7S_TSM_forExp indicator? If yes, which ones?
4. What changes should be made in N7S_AO_772012_M1 or N7S_AO_772012_L9_2 to work correctly on SystemForex terminal, i.e. with four signs?
It is useless for me to explain about the losses and stops. You need to poke me in the EA's progamming text and show me what to fix there. I.e., I would be able to understand that so-and-so line in the EA should be replaced with so-and-so.
The answer is .
1.Right
2) Correct.
3. When setting the parameters of the Expert Advisor, select Indctr=2
4. "It's no use explaining moose and stops to me yet." My opinion is that it's no use explaining the rest either. For now.
Answer
1.Correct.
2) Correct.
3.Select Indctr=2 when setting EA parameters
4. "It is useless for me to explain about the lots and stops for now." My opinion is that it is useless to explain the rest as well. Bye.
Thanks mate))))
I didn't even expect anyone to answer.
Regarding the fourth point, it was about where in the text of the program to make corrections?
The text is attached:
//SHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.
//Sh N7S_AO_772012_9.mq4 v.77.2012 Sh//
//Sh Hunter by profit Sh//
//Sh Balashiha S&N@yandex.ru ///
//Sh Version January 31, 2009 ///
//SHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.
//L2 version with clear Buy & Sell separation
#property copyright "Copyright © 2007, Shooter777"
#property link "S7N@mail.ru"
#include <WinUser32.mqh>
#include <stderror.mqh>
#include <stdlib.mqh>
//------------------------------------------------------------------//
int HM_ALL = 18; //
int Trade = 1; //
//------------------------------------------------------------------//
extern bool Trd_Up_X = true; int HM_Up_X = 1; // ////
//------------------------------------------------------------------//
//extern
double tpx = 5;
extern double slx = 500; extern int px = 10;
extern int x1 = 0;extern int x2 = 0;extern int x3 = 0;extern int x4 = 0;int tx = 0;
//------------------------------------------------------------------//
extern bool Trd_Dn_Y = true; int HM_Dn_Y = 1; ////
//------------------------------------------------------------------//
//extern
double tpy = 5; extern double sly = 500;extern int py = 10;
extern int y1 = 0;extern int y2 = 0;extern int y3 = 0;extern int y4 = 0; int ty = 0;
//------------------------------------------------------------------//
extern string Text0="BTS F=1";
extern int F = 1; extern int pz = 10;
extern int z1 = 0; extern int z2 = 0; extern int z3 = 0; extern int z4 = 0; int tz = 0;
//------------------------------------------------------------------//
//------------------------------------------------------------------//
extern string Text1="Neyro G=4"; extern int G = 4; extern string Text2="XXXXXXXXXXX";
//extern
extern double tpX = 5; extern double slX = 500;extern int pX = 10;
extern int X1 = 0;extern int X2 = 0;extern int X3 = 0;extern int X4 = 0;int tX = 0;
//------------------------------------------------------------------//
extern string Text3="YYYYYYYYYY";
//extern
double tpY = 5; extern double slY = 500;extern int pY = 10;
extern int Y1 = 0; extern int Y2 = 0; extern int Y3 = 0; extern int Y4 = 0; int tY = 0;
//------------------------------------------------------------------//
extern string Text4="ZZZZZZZZZZZZZ";extern int pZ = 10;
extern int Z1 = 0;extern int Z2 = 0;extern int Z3 = 0;extern int Z4 = 0;int tZ = 0;
//------------------------------------------------------------------//
//------------------------------------------------------------------//
extern double lots = 0.1;
extern inttern Indctr = 1;
//------------------------------------------------------------------//
bool TrBlnc = true; int StrtBlnc = 2500; int DBlnc = 2000; int UBlnc = 3500;
//------------------------------------------------------------------//
int mn;int mnx1 = 772012055;int mny1 = 772012155;int mnX1 = 772012011;int mnY1 = 772012111;
static int prvtm = 0;static double sl = 10;static double tp = 10;
bool cm15=false; bool cmH1=false; bool cmH4=false;
int MMH1 ;int MN ;
static int bu,sll;
static bool Flg=false;
static bool FlqB=true; static bool FlqS=true;
int i;int ticket = -1;int total;int spread;
datetime LFB;
double prcptx1=0,prcpty1=0,prcptX1=0,prcptY1=0,prcptZ1=0;
static double Delta_G12,iCusAO_1,iCusAO_2,iCusTSM_1,iCusTSM_2,Dlt_AO12,Dlt_TSM12;
//+------------------------------------------------------------------+
//| expert init function |
//+------------------------------------------------------------------+
int init(){MMH1 = Hour( );LFB = iTime(Symbol(), 0, 0); H1();
Delta_G12 = G12( ); if ( IsOptimization( ) ) TrBlnc = false;if ( IsTesting( ) ) TrBlnc = false;
if (VSR () !=0) {Flg=false;} else {Flg=true;}
cmmnt();}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ if ( x1==0&x2==0&&x3==0&x4==0&y1==0&&y2==0&y3==0&&y4==0)return (0);
if (!Flg){if (VSR () ==0) {Flg=true; return (0);}}
total = OrdersTotal();//spread = MarketInfo(Symbol(), MODE_SPREAD);
int iTm = iTime(Symbol(), 0, 0);if(LFB == iTm) return(0); LFB = iTime(Symbol(), 0, 0);
int MMM15 = MathMod(Minute( ), 15);
if(cm15) {if(MMM15 == 0 ) {cm15 =false; }} if(MMM15 !=0){cm15=true;}
if(Hour( ) != MMH1) {MMH1 = Hour( ); H1( );}
int MMH4 = MathMod(Hour( ), 4);
if(cmH4) {if(MMH4 == 0 ) {cmH4 =false;
Delta_G12 = G12();
FlqB = true ;FlqS = true ;
}}
if(MMH4 !=0){cmH4=true ; }
trl();
startM5();
cmmnt();}
double G12() {switch(Indctr)
{case 0:
iCusAO_1 = iAO(NULL, 240, 1); iCusAO_2 = iAO(NULL, 240, 2);
iCusTSM_1 = iCusTSM (24, 1); iCusTSM_2 = iCusTSM (24, 2);
Dlt_AO12 = iCusAO_1 -iCusAO_2; Dlt_TSM12 = iCusTSM_1-iCusTSM_2;
if ( Dlt_AO12>=0 && Dlt_TSM12 <=0) return (0);
if ( Dlt_AO12<=0 && Dlt_TSM12 >=0) return (0);
return(Dlt_AO12);
case 1:
iCusAO_1 = iAO(NULL, 240, 1); iCusAO_2 = iAO(NULL, 240, 2);
Dlt_AO12 = iCusAO_1 -iCusAO_2; return(Dlt_AO12);
case 2:
iCusTSM_1 = iCusTSM (24, 1); iCusTSM_2 = iCusTSM (24, 2);
Dlt_AO12 = iCusTSM_1-iCusTSM_2; return(Dlt_AO12);
case 3:
iCusAO_1 = iMA(NULL,60,12,0,MODE_EMA,PRICE_CLOSE,1)-iMA(NULL,60,26,0,MODE_EMA,PRICE_CLOSE,1);
iCusAO_2 = iMA(NULL,60,12,0,MODE_EMA,PRICE_CLOSE,2)-iMA(NULL,60,26,0,MODE_EMA,PRICE_CLOSE,2);
Dlt_AO12 = iCusAO_1 -iCusAO_2; return(Dlt_AO12);}}
//+--------------------------------------------------------------------------------------+
double iCusTSM (int pr, int shft)
{ return (iCustom(NULL, 240, "iCus_N7S_TSM_forExp",pr,1,shft)); }
//+--------------------------------------------------------------------------------------+
double BTS() {
if ((prcptrnz1() > 0 || F==0))//& bu<HM_Up_X)
{if (prcptx1 > 0 && Delta_G12>0) {sl = slx; tp = tpx*slx; mn= mnx1; return (1);}}
if ((prcptrnz1() < 0 || F==0))//& sll<HM_Dn_Y)
{if (prcpty1 > 0 && Delta_G12<0) {sl = sly; tp = tpy*sly; mn= mny1 ;return (-1);}}
return (0);}
//+--------------------------------------------------------------------------------------+
double prcptrnAC(int q1,int q2,int q3,int q4,int pr,int at)
{double qw = (q1-50)+((q2-50)*iA_C(pr)+(q3-50)*iA_C(2*pr)+(q4-50)*iA_C(3*pr))/iA_C(1);
if (MathAbs(qw)>at) return(qw);else return(0);}
//+--------------------------------------------------------------------------------------+
double iA_C (int pr){int tmfr=60; return(iAO(Symbol(), tmfr, pr));}
//+--------------------------------------------------------------------------------------+
void BuSll ( int pl, int OrdTp, int mgnmb) // pl-source 0-acting 1-closed // OrdTp=order type 1-market(0and1) 3-LIMIT(2and3) 5-STOP(4and5)
{ switch(pl)
{case 0: bu=0; sll=0; int ChTpBu,ChTpSll; // Print (" OrdTp ",OrdTp); // count B&S market orders
switch(OrdTp)
{case 1: ChTpBu=OP_BUY; ChTpSll=OP_SELL; break;
case 3: ChTpBu=OP_BUYSTOP; ChTpSll =OP_SELLSTOP; break;
case 5: ChTpBu=OP_BUYLIMIT;ChTpSll =OP_SELLLIMIT; break;}
for(int i=0;i<OrdersTotal();i++)
{OrderSelect(i, SELECT_BY_POS, MODE_TRADES); int OMN=OrderMagicNumber();
if(OrderSymbol() != Symbol()){continue;}
if(OrderType()==ChTpBu &&(OMN>=mgnmb && OMN<=mgnmb+99)){ bu++;}
if(OrderType()==ChTpSll &&(OMN>=mgnmb+100 && OMN<=mgnmb+199)){sll++;}
}break;
case 1: int pstv=0, ngtv=0; // history analysis selected
Print ("Order count in history"); break;}}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double prcptrnz1() {double qz =(z1-50)*(Close[1]-Open[pz])+(z2-50)*(Open[pz]-Open[pz*2])
+(z3-50)*(Open[pz*2]-Open[pz*3])+(z4-50)*(Open[pz*3]-Open[pz*4]);return(qz);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double prcptrnZ1() {double qZ =(Z1-50)*(Close[1]-Open[pZ])+(Z2-50)*(Open[pZ]-Open[pZ*2])
+(Z3-50)*(Open[pZ*2]-Open[pZ*3])+(Z4-50)*(Open[pZ*3]-Open[pZ*4]);return(qZ);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void trl(){
total= OrdersTotal(); spread = MarketInfo(Symbol(), MODE_SPREAD);
for( i = total-1; i >= 0; i--)
{ OrderSelect(i, SELECT_BY_POS, MODE_TRADES); MN=OrderMagicNumber();
if(OrderSymbol() == Symbol() && MN>= 772012000 && MN<=772012199)
{ if (MN==772012055) {sl = slx; tp = tpx*slx; mn= mnx1;}
if (MN==772012155) {sl = sly; tp = tpy*sly; mn= mny1;}
if (MN==772012011) {sl = slX; tp = tpX*slX; mn= mnX1;}
if (MN==772012111) {sl = slY; tp = tpY*slY; mn= mnY1;}
int prevticket = OrderTicket();if(OrderType() == OP_BUY)
{if(FLG(0)) { OrderClose(prevticket,OrderLots( ),Bid,slppg(),Black);}
if(Bid > (OrderStopLoss() + (sl * 2 + spread) * Point)
{ if(VSR()< 0) { OrderClose(prevticket,OrderLots( ),Bid,slppg(),Black);}
else { OrderModify(OrderTicket(),OrderOpenPrice(),Bid - sl * Point,0, 0, Blue);}}}
else {if(FLG(0)) { OrderClose(prevticket,OrderLots( ),Ask,slppg(),Blue);}}
if(Ask < (OrderStopLoss() - (sl * 2 + spread) * Point)
{if(VSR() > 0)
{ OrderClose(prevticket,OrderLots( ),Ask,slppg(),Blue);}
else{ OrderModify(OrderTicket(),OrderOpenPrice(),Ask + sl * Point,0,0,Blue);}}}
}}}
//+SHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.
double VSR() { prcptZ1 = prcptrnZ1();
if(G==4){ if(prcptZ1>0){if(prcptX1>0 && Delta_G12>0){sl = slX; tp = tpX*slX; mn= mnX1;return ( 1);}}
else {if(prcptY1>0 && Delta_G12<0){sl = slY; tp = tpY*slY; mn= mnY1;return ( -1);}}
return(BTS());}
if(G==3){ if(prcptY1>0 && Delta_G12<0){sl = slY; tp = tpY*slY; mn= mnY1;return (-1);}
else {return (BTS());}}
if(G==2){ if(prcptX1>0 && Delta_G12>0){sl = slX; tp = tpX*slX; mn= mnX1;return ( 1);}
else {return(BTS();}}
if(G==9){ if(prcptX1>0 && Delta_G12>0 && bu <HM_Up_X){sl = slX; tp = tpX*slX; mn= mnX1;return ( 1);}
if(prcptY1>0 && Delta_G12<0 && sll<HM_Dn_Y){sl = slY; tp = tpY*slY; mn= mnY1;return (-1);}
return (BTS());}
return (BTS());}
void H1() { prcptx1 = prcptrnAC(x1,x2,x3,x4,px,tx) ;
prcpty1 = prcptrnAC(y1,y2,y3,y4,py,ty) ;
prcptX1 = prcptrnAC(X1,X2,X3,X4,pX,tX) ;
prcptY1 = prcptrnAC(Y1,Y2,Y3,Y4,pY,tY) ;
//if (Symbol()!="GBPJPY" || Symbol()!="USDCHF"){ FlqB = true ;FlqS = true ; }
BuSll (0,1,772012000);
}
//+------------------------------------------------------------------+
void startM5() {ticket = -1 ; RefreshRates();
if (total < HM_ALL) { BuSll (0,1,772012000); cmmnt();
if( FLG(1))
{if (Trd_Up_X && VSR() > 0 && bu <HM_Up_X && FlqB) {
if (MOS( 0, lots, sl, tp, WindowExpertName(), mn)>=1) {FlqB=false;}}
if (Trd_Dn_Y && VSR() < 0 && sll<HM_Dn_Y && FlqS) {
if (MOS( 1, lots, sl, tp, WindowExpertName(), mn)>=1) {FlqS=false;}}
}}}
//+------------------------------------------------------------------+
bool FLG (int cs )
{ int AE = AccountEquity( ) ;
switch(cs)
{case 0: if((DayOfWeek( ) == 5 && Hour( ) >=22) || (TrBlnc && (AE > UBlnc))
return (true);else return (false);
case 1: if (DayOfWeek( ) == 1 && Hour( ) <14) {
string dttm = StringConcatenate (Year(),".",Month(),".",Day());
datetime smtm=StrToTime(dttm);
bool Gp;
int shft = iBarShift(NULL,0,smtm);
double iOpn = iOpen (NULL,0,shft); double iCls = iClose (NULL,0,shft+1);
double dOC = MathAbs ((iOpn - iCls)/(Point*10)) ;
if (dOC>20) Gp = true ;
//string var1=TimeToStr(smtm,TIME_DATE|TIME_SECONDS;)
}
if((TrBlnc && ((AE > UBlnc)||(AE < DBlnc))
|| ((DayOfWeek( ) == 1 && Hour( ) <2) || (DayOfWeek( ) == 5 && Hour( ) >=18))
|| ((DayOfWeek( ) == 1 && Hour( ) <14) && Gp))
return (false);else return (true);
}
}
//+------------------------------------------------------------------+
int MOS(int Op_,double Vl,double StLs, double TkPt,string cmnt,int mgc)
{ bool OrSd = false;
if(!(Op_==0 ||Op_==1)){Print ("Error!!!Order not set! Wrong type!");return (-1);}
else {OrSd = true;}
datetime Begin=TimeCurrent();
int err,rslt; double prc; color clr;
switch (Op_)
{case 0: prc=Ask; clr=Green; StLs= Bid - StLs * Point; TkPt=Bid + TkPt * Point ;break;
case 1: prc=Bid; clr=Red; StLs= Ask + StLs * Point; TkPt=Ask - TkPt * Point ;break;}
if( OrSd )
{rslt= OrderSend(Symbol(),Op_,Vl,prc,slppg(),StLs,TkPt,cmnt,mgc,0,clr);
if (rslt==-1)
{err=GetLastError(); Print("Error setting the order!!!(",err,") ");
if(!IsTesting())
{while(!((( rslt>0 || TimeCurrent()-Begin>20))
{Sleep(1000); RefreshRates();
rslt= OrderSend(Symbol(),Op_,Vl,prc,slppg(),StLs,TkPt,cmnt,mgc,0,clr); }}}}
return(rslt);}
//+------------------------------------------------------------------+
int slppg()
{ int sprd =2*MarketInfo(Symbol(),MODE_SPREAD);return ( sprd );}
void cmmnt(){ if ( !IsOptimization( ) ){
Comment("Buy ",bu," Sell ",sll," symbol ",Symbol(),
"\n Delta_G12 ",Delta_G12,
"\n x ",prcptx1," y ",prcpty1," z ",prcptrnz1(),
"\n X ",prcptX1," Y ",prcptY1," Z ",prcptrnZ1(),
"\n VSR ",VSR (),
"\n Flg ",Flg," FlqBS ",FlqB," @ ",FlqS,
"\n FLU ",FLG(1)," FLD ",FLG(0) );}}
Can you mark in red what should be corrected and in blue type in what to correct?
Can you mark in red what needs to be corrected and in blue what needs to be corrected?
I have to check, but I don't think anything needs to be changed. The changes concern the installation set files. Autoselect slipage I have inserted. Let's ask those of you on the 4 digits.
I'll have to check, but I don't think anything needs to be changed. The changes concern the installation set files. I've inserted the autosampling slipage. Let's ask those who are still on 4 digits.
Thanks, I just have two sets of your setup set files, for five characters, and for four.
But I'll still ask the people.
People!!! Who are sitting on four digits in quotes.
Has anyone made any fixes to the N7S_AO_772012_M1 EA (or previous versions) to work in four digit terminals?
Everything works correctly on four-digit terminals?
Today tested my other EAs from the beginning of the year, including indicator ones. In last two weeks none of them showed positive results. I also optimized M1 using different methods and the last week was disadvantageous anyway. I think the last week was difficult for many strategies.
I turned out to be in the plus. So it is a bad sign for my settings. ((
When optimizing N7S_AO_772012_M1 Expert Advisor with one indicator and in the second case with two indicators, the second indicator iCus_N7S_TSM_forExp revealed the following relationship:
In the first case, the maximum profit at different stages of optimization is higher than in the second case by 30-100%.
In the first case, the number of deals at maximum profit at different stages is about twice as high as in the second case.
In general, the number of deals is very low.
Who knows what parameters of the Expert Advisor should be changed and in what direction to increase the number of deals during optimization?
Vovanic, even laughed. )
We are all here to collectively figure out: which parameters, in which direction and at what time to change in order to make a buck )))