[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 379

 
globad:
I think there's plenty of ready-made stuff like this. A simple EA opens one deal at a given time...

The trouble is that for all the time the possibility of programming for MT4 has accumulated HUNDREDS of ready-made EAs in the free access to the Internet, that finding the right one is very problematic - you will have to search through a lot of junk, and it may even take more than one month. In addition, there's still no guarantee that the code you've found won't be written incorrectly. Code made to order not only saves time and effort, but can also be quickly corrected by the developer, if the customer sees that something is not working as ordered.
 
Vinin:


Thank you!!!
 
artmedia70:

What does the function do anyway?

It returns zero anyway... So I asked the question without looking at the syntax.


Well, it's a template..... Damn, what can it be, I updated the build and EA started to part, moreover, the same EA on another old build, works, opens deals, etc.

if (b!=Bars){
b=Bars;

      if (iCustom(NULL, 0, "1111",set,up,zukko1,7,1)!=0){
      TotalOrders=OrdersTotal(); 
           for (i=0; i<=TotalOrders; i++){
                 if (OrderSelect(0,SELECT_BY_POS)==true){
                    if (OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,5,Red);
                 if (OrderSelect(0,SELECT_BY_POS)==true){   
                    if (OrderType()==OP_BUYSTOP) OrderDelete(OrderTicket(),Green);                    
                 }
                 }            
           }  
                       
    // if (OrdersTotal()==0) 
    OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Bid-StopLoss*Point,Bid+TakeProfit*Point);
      //OrderSend(Symbol(),OP_SELLSTOP,Lot,Bid-StopLoss*Point,3,Bid-StopLoss*Point+OPStopLoss*Point,Bid-StopLoss*Point-OPTakeProfit*Point);
       }
      if (iCustom(NULL, 0, "111111",set,up,zukko1,6,1)!=0){
      TotalOrders=OrdersTotal();
        for (i=0; i<=TotalOrders; i++){
                 if (OrderSelect(0,SELECT_BY_POS)==true){
                    if (OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,5,Red);
                 if (OrderSelect(0,SELECT_BY_POS)==true){   
                    if (OrderType()==OP_SELLSTOP) OrderDelete(OrderTicket(),Green);
                 }   
                 }
        }              
     //if (OrdersTotal()==0) 
     OrderSend(Symbol(),OP_SELL,Lot,Bid,3,Ask+StopLoss*Point,Ask-TakeProfit*Point);
     // OrderSend(Symbol(),OP_BUYSTOP,Lot,Ask+StopLoss*Point,3,Ask+StopLoss*Point-OPStopLoss*Point,Ask+StopLoss*Point+OPTakeProfit*Point);
         }
  }

Can anyone help.... EA is supposed to work once per bar. And it's hitting it hard....

 
drknn:

That's the trouble, for all the time the possibility of programming for MT4 has been accumulated in the free access to HUNDREDS of ready-made EAs in the Internet, that finding the right one is very problematic - you will have to search through a lot of junk, and it may even take more than one month. In addition, there's still no guarantee that the code you've found won't be written incorrectly. Code made to order not only saves time and effort, but can also be quickly corrected by the developer, if the customer sees that something is not working as ordered.
How much would such an EA cost, do you think?
 

Good afternoon!

Here is such a problem....

In the complex indicator, I have created a graphical display of fractals (so as not to apply the fractal indicator)

For top fractals (arrows)

double P_F_5_Up = Price_UP_1 + Positiont;
               string name="Up_F5"+"_"+s;
               
               ObjectCreate( name, OBJ_ARROW, 0, Time[s], P_F_5_Up);
               ObjectSet( name,OBJPROP_COLOR,Color_F5);
               ObjectSet( name,OBJPROP_ARROWCODE,217);
               ObjectSet(name,OBJPROP_WIDTH,2);

For lower fractals (arrows)

double P_F_5_DW=Price_DW_1 - Positiont;
               name="DW_F5"+"_"+s;
               
               ObjectCreate( name, OBJ_ARROW, 0, Time[s], P_F_5_DW);
               ObjectSet( name,OBJPROP_COLOR,Color_F5 );
               ObjectSet( name,OBJPROP_ARROWCODE,218);
               ObjectSet(name,OBJPROP_WIDTH,2);
Fractal arrows

are displayed in the main window at a distance from High/Low by the Positiont value, which is defined in init()

Positiont*=Point;

The problem is this: for lower fractals the graphical objects (arrows) are displayed according to Positiont, while for higher ones they stick to the High/Low candlestick, i.e. they do not see Positiont.

Why? I don't understand....

 
LOA:


Why? I don't understand....

Maybe add the height of the object still.
 
splxgf:
Maybe add the height of the object as well.


How do you do this?

And, to be honest, I doubt it will help (although I'll give it a try if you tell me how).

Graphic objects are standard characters for both high and low.

 
double P_F_5_Up = Price_UP_1 + Positiont*2;
The position is counted from the top left-hand corner, the bottom is fine, the top needs an extra margin.
 
splxgf:
The position is counted from the top left corner, the bottom is fine, the top needs an extra margin.

OK. I understand and did it, but it didn't work with *2, but with *4 it's great. Thank you very much - I didn't know this nuance (although there's a lot more I don't know, but I'm learning it).
 
Reshetov:
See https://www.mql5.com/ru/forum/131859/page6#434260


GetExtremumZZZPrice() function


Thank you very much.
Reason: