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

 
skyjet:
Hi! Can you tell me how to teach my Expert Advisor to detect fractals?

I would like to know more details. There are a lot of different indices that can draw and find fractals. The Expert Advisor does not need to detect them. You take the indicator and copy the values of a certain fractal from its buffers. Nothing complicated if you pay attention to it.
 

Good day! Guys, advise me on this issue: in the Strategy Tester, the exp opens orders according to the algorithm and scheme of increasing the size of the channel of subsequent averages - you can see it in the picture - each subsequent averaging is opened at a larger distance from the previous one (like in Ilan). But at the same time, the printer produces such values of expressions, that the averaging should not take place, because the conditions for their opening are not fulfilled 25 any more than 2856, 2197, 1690. How does it enter this condition and open positions at all? I decided to encircle everything with braces, but it does not help.

A test on opening prices. Here is the code and picture:

...
// Внешние переменные (оптимизируются)
extern string A1 = " Параметры ММ ";
extern double Lots = 0.02;         // Стартовый лот

//-------------------                                  
extern double LotExponent = 2.7;  // на сколько умножать стартовый лот в степени - схема по Илану                                   

extern string A2 = " В настоящих пипсах ";
extern int StopLossPips_BUY = 100;   // уровень стартового усреднения в бай  объёма позиции в пипсах 


// Увеличение шага усреднений по схеме

extern double PipStepExponent_BUY  = 1.3; // на сколько умножать стартовый шаг в степени 

//-----------------------------------------------------------------------

.....

// если стартовая открыта и достигнут уровень усреднения, то усреднить на  Lots * MathPow(LotExponent,NumberOfPositions(Symbol(), -1, MN_L));  
    if (NumberOfPositions(Symbol(), -1, MN_L)>=1 && 
       GetProfitOpenPosInCurrency(Symbol(), -1, MN_L)<0)   
      // if (MathAbs (GetProfitOpenPosInPoint(Symbol(), -1, MN_L)) > StopLossPips)  
          {
           if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_BUY) 
              if (MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L)<0) // надо ли усреднять
                {
                 if (NumberOfPositions(Symbol(), -1, MN_L)==1) 
                    {// при первом усреднении, усреднять через стартовое количество пунктов - StopLossPips_BUY
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0)>StopLossPips_BUY)                 
                     {WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " первое усреднение вверх ", MN_L);
                      Print (" первое усреднение ");
                     }
                    } 
                 if (NumberOfPositions(Symbol(), -1, MN_L)>1) // при последующих - усреднять через  MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))  
                    {
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0) > 
                          NormalizeDouble((StopLossPips_BUY* MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1)),0))                                           
                     {
                       WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " усреднение вверх ", MN_L);          
                       Print (" последующие, если это больше ", NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),
                              " этого, то открыть бай ", NormalizeDouble(StopLossPips_BUY*MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1),0));
                     }
                    }
                 }   
                     
              
           if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_SELL) 
               if ((PriceOpenLastPos(Symbol(), OP_SELL, MN_L)-MarketInfo(OrderSymbol(), MODE_ASK))<0)
               
                  if (NumberOfPositions(Symbol(), -1, MN_L)==1)
                     {
                      if (NormalizeDouble((MathAbs(PriceOpenLastPos(Symbol(), OP_SELL, MN_L)-MarketInfo(OrderSymbol(), MODE_ASK))/Point),0)>StopLossPips_SELL)           
                      WmOrderSend(Symbol(), OP_SELL,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_SELL,MN_L))),Bid, 0, TP_START_SELL, " усреднение вниз ", MN_L);         
                     }
                     
          }           
.....

 
skyjet:
Hi, can you tell me how to teach the Expert Advisor to detect fractals?

See navigator. If it's about this, it's like this.
 
Roman.:

Good day! Guys, advise me on this issue: in the Strategy Tester, the exp opens orders according to the algorithm and scheme of increasing the size of the channel of subsequent averages - you can see it in the picture - each subsequent averaging is opened at a larger distance from the previous one (like in Ilan). But at the same time, the printer produces such values of expressions, that the averaging should not take place, because the conditions for their opening are not fulfilled 25 any more than 2856, 2197, 1690. How does it enter this condition and open positions at all? I decided to encircle everything with braces, but it does not help.

A test on opening prices. Here is the code and picture:


As I understand it, without seeing all the code and learning how it works here, it is unlikely that anyone will tell you. All the functions used in this block are known only to you. It is best to print everything as you go along and keep an eye on the output of the messages.
 
hoz:

As I understand it, without seeing all the code and learning how it works here, I don't think anyone can tell you. All the functions used in this block are known only to you. It's best to print everything as you go along and watch the output of the messages.

All functions work properly - these are functions of Kim I.V. "Only useful functions from Kim I.V." From the name of the functions - their purpose is clear.
 

I figured it out - everything is working properly. It should have been printed BEFORE opening the position.

 if (GetTypeLastOpenPos(Symbol(), MN_L)==OP_BUY) 
              if (MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L)<0) // надо ли усреднять
                {
                 if (NumberOfPositions(Symbol(), -1, MN_L)==1) 
                    {// при первом усреднении, усреднять через стартовое количество пунктов - StopLossPips_BUY
                     if ( NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0)>StopLossPips_BUY)                 
                        {
                         Print (" первое усреднение ",NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),
                                " StopLossPips_BUY = ",StopLossPips_BUY, " MODE_BID = ", DoubleToStr(MarketInfo(OrderSymbol(), MODE_BID),Digits), " PriceOpenLastPos = ", DoubleToStr(PriceOpenLastPos(Symbol(), OP_BUY, MN_L),Digits), "P = ", DoubleToStr(Point,Digits));                 
                         WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " первое усреднение вверх ", MN_L);
                        }
                    } 
                 if (NumberOfPositions(Symbol(), -1, MN_L)>1) // при последующих - усреднять через  MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))  
                    {
                     if (NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0) > 
                         NormalizeDouble((StopLossPips_BUY* MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1)),0))                                           
                     {
                        Print (" последующие, если это больше ", DoubleToStr(NormalizeDouble((MathAbs(MarketInfo(OrderSymbol(), MODE_BID)-PriceOpenLastPos(Symbol(), OP_BUY, MN_L))/Point),0),Digits),
                              " этого, то открыть бай ", DoubleToStr(NormalizeDouble(StopLossPips_BUY*MathPow(PipStepExponent_BUY,NumberOfPositions(Symbol(),OP_BUY,MN_L)-1),0),Digits),
                              " MODE_BID = ", DoubleToStr(MarketInfo(OrderSymbol(), MODE_BID),Digits), " PriceOpenLastPos = ", DoubleToStr(PriceOpenLastPos(Symbol(), OP_BUY, MN_L),Digits));
                       WmOrderSend(Symbol(), OP_BUY,  NormalizeLots(Lots*MathPow(LotExponent,NumberOfPositions(Symbol(),OP_BUY,MN_L))), Ask, 0, TP_START_BUY, " усреднение вверх ", MN_L);          
                                           }
                    }
                 }   
           

The averaging position was opened according to the algorithm and the PriceOpenLastPos(Symbol(), OP_BUY, MN_L) function returned the value of the position just opened, that is why I had questions.

Thank you, hoz.

 

Roman, Glad it worked out for you :) And also, so fast.

Basically, my compiler has started to swear again. There is a library that uses a class in it. The class of course is included into the library:

#include <HOZ_Code\Classes\CLogging.mqh>

CLogging logging;

When compiling this library, which uses the CLogging.mqh class, the compiler swears like this:

'#property' - name expected     CLogging.mqh    6       1

In the class on this line:

What can all this mean?

 
How does the script enable/disable the display of trading levels?
 

Help!!!

In an EA from the public forum I attached a 3-bar pattern to a trade entry condition.

After optimization and testing (3.5 years) I have installed ten windows on one demo account with individual settings in each, which provided the speed of owl deals at least 1.5 per day. The same speed is ensured on 10 virtual computers on my server - one window in each.

A week has gone by but not a single deal has been made anywhere.

What to do?

=========================

int GetSignal()
{
double LevelADX = iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0);
double Delta_01_ADX =(iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0)
- iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,2));
double mas,maf;
mas=iMA(NULL,TF_MA,Slow.period,0,Slow.metod,Slow.price,1);
maf=iMA(NULL,TF_MA,Fast.period,0,Fast.metod,Fast.price,1);
//------------------
double delta1,delta2;

delta1=NormalizeDouble((Close[1]-Close[2])/Point,5);
delta2=NormalizeDouble((Close[2]-Close[3])/Point,5);

double body3=NormalizeDouble((Open[3]-Close[3])/Point,5)
//------------------
int STsig=-1;
if(CrossLevel && Lines>0) {
int up,dw;
int up_l,dw_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][0]<LevelDw) dw++; else{
if(ST[jj][0]>LevelUp) up++;
}
if(ST[jj][1]<LevelDw) dw_l++; else{
if(ST[jj][1]>LevelUp) up_l++;
}
}
if(up<=8-Lines && up_l>8-Lines) STsig=1;
if(dw<=8-Lines && dw_l>8-Lines) STsig=0;
}
if(STsig==-1 && BreakSweep) {
double big,small;
double big_l,small_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][1]>big_l) big_l=ST[jj][1];
if(ST[jj][1]<small_l || small_l==0) small_l=ST[jj][1];
}
if(big_l-small_l<=Sweep && (small_l>=LevelUp || big_l<=LevelDw)) {
for(jj=0;jj<8;jj++) {
if(ST[jj][0]>big) big=ST[jj][0];
if(ST[jj][0]<small || small==0) small=ST[jj][0];
}
if(big-small>Sweep)

{

//--------------- my Volume [] and Open [] and Close [] add-ons ------------------------------

if(Close[1]>Close[2]&& Close[2]>Close[3]&& Close[3]<Open[3] && Close[2]>High[3]
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && big_l<=LevelDw && maf>mas)
STsig=0;

if(Close[1]<Close[2]&& Close[2]<Close[3]&& Close[3]>Open[3] && Close[2]<Low[3]
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && small_l>=LevelUp && maf<mas)
STsig=1;
}

}

}

if(Volume[0]<2 && Volume[1]>Volume1 && Volume[2]>Volume2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==0) return(OP_BUY);

if(Volume[0]<2 && Volume[1]>Volume1 && Volume[2]>Volume2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==1) return(OP_SELL);
return(-1)

}

=================================================

Thanks in advance!

 
SashGMQL4:

Help!!!

I've attached a 3-bar pattern to the deal entry condition in the EA shared on the forum.

After optimization and testing (3.5 years) I have set ten windows on one demo account with individual settings in each, which provided the speed of owl at least 1.5 deals a day. The same speed is provided on 10 virtual computers on my server - one window in each.

It's been a week, but no deals have been made anywhere.

What can I do?

=========================

int GetSignal()
{ 
double LevelADX = iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0);
double Delta_01_ADX =(iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,0)
- iADX(NULL,TF_ADX,PeriodADX,4,MODE_MAIN,2));
double mas,maf;
mas=iMA(NULL,TF_MA,Slow.period,0,Slow.metod,Slow.price,1);
maf=iMA(NULL,TF_MA,Fast.period,0,Fast.metod,Fast.price,1);
//------------------ 
double delta1,delta2;

delta1=NormalizeDouble((Close[1]-Close[2])/Point,5);
delta2=NormalizeDouble((Close[2]-Close[3])/Point,5);

double body3=NormalizeDouble((Open[3]-Close[3])/Point,5); 
//------------------
int STsig=-1; 
if(CrossLevel && Lines>0) {
int up,dw;
int up_l,dw_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][0]<LevelDw) dw++; else{
if(ST[jj][0]>LevelUp) up++; 
}
if(ST[jj][1]<LevelDw) dw_l++; else{
if(ST[jj][1]>LevelUp) up_l++; 
}
}
if(up<=8-Lines && up_l>8-Lines) STsig=1; 
if(dw<=8-Lines && dw_l>8-Lines) STsig=0; 
}
if(STsig==-1 && BreakSweep) {
double big,small;
double big_l,small_l;
for(jj=0;jj<8;jj++) {
if(ST[jj][1]>big_l) big_l=ST[jj][1];
if(ST[jj][1]<small_l || small_l==0) small_l=ST[jj][1];
}
if(big_l-small_l<=Sweep && (small_l>=LevelUp || big_l<=LevelDw)) {
for(jj=0;jj<8;jj++) {
if(ST[jj][0]>big) big=ST[jj][0];
if(ST[jj][0]<small || small==0) small=ST[jj][0];
}
if(big-small>Sweep) 

{

//--------------- мои прикрутки Volume [], а также Open [] и Close [] ------------------------------

if(Close[1]>Close[2]&& Close[2]>Close[3]&& Close[3]<Open[3] && Close[2]>High[3] 
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && big_l<=LevelDw && maf>mas) 
STsig=0;

if(Close[1]<Close[2]&& Close[2]<Close[3]&& Close[3]>Open[3] && Close[2]<Low[3]
&& body3>=Body3 && delta1>=Delta1 && delta2>Delta2 && small_l>=LevelUp && maf<mas) 
STsig=1;
}

}

}

if(Volume[0]<2 && Volume[1]>Volume1 && Volume[2]>Volume2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==0) return(OP_BUY); 

if(Volume[0]<2 && Volume[1]>Volume1 && Volume[2]>Volume2
&& Delta_01_ADX > DeltaADX && LevelADX < StopADX && STsig==1) return(OP_SELL);
return(-1);

}

=================================================

Thanks in advance!

try activating the EA button (Auto trade)