[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 148

 
eddy:

so I want to create an object in blue)

sergeev, soindicator_color1 is a colour variable?

int init() {
   IndicatorBuffers(2);
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 3);
   SetIndexArrow(0, 108);
   SetIndexBuffer(0, g_ibuf_96);
   SetIndexBuffer(1, g_ibuf_100);
   SetIndexEmptyValue(0, 0.0);
   ArraySetAsSeries(g_ibuf_96, TRUE);
   ArraySetAsSeries(g_ibuf_100, TRUE);
   IndicatorShortName("ZigZag(" + ExtDepth + "," + ExtDeviation + "," + ExtBackstep + ")");
   return (0);
}
here are the circles
 
alsu:

noooooo.

Suppose we have an indicator that draws a line. Suppose we want to draw a circle with this indicator. But we want to make it green if the indicator line is green, and red if it is red.

:)) so what's the problem?
 
Do NOT ignore the request!!! Please.
 
Luteciy:
Do NOT ignore the request!!! Please.
it seemed to me that your request has nothing to do with this thread. If you want someone else to write the code to the specified TOR instead of you, then go to https://www.mql5.com/ru/job
 
Thank you
 

Good people!

I know the situation is idiotic, but I can't help it. I cannot make friends with the "OrderSelect" function.

My TCP requires only one open order. Please, pass me the algorithm of order closing in the following case:

If the number of market orders = 1, it is a buy order and condition 1 is fulfilled (I will insert it myself), then

close it at the current price.

and if it is a sell order and condition 2 is fulfilled (I will also insert it myself) then

we close it at the current price.

Again, the program can open only one order - we do not have to search for it among thousands of orders!

Thank you.

 
find a script or function to close the order(s) and insert your conditions
 
You can create functions with optional parameters, can you make a function that returns the sum of the values passed to it, so that their number is unlimited, or at least limited, but large)
 
//+------------------------------------------------------------------+
//|// Проверка смены тренда                                            |
//+------------------------------------------------------------------+
bool TrendChange(int Period_MAb,int Period_MAm,int shPer)
{
  int i;
bool TrendCh[i];
  for (int i=0; i<shPer; i++) {       
         double MAbSh[i]=iMA(NULL,0,Period_MAb,0,MODE_EMA,PRICE_WEIGHTED,i); // 
         double MAmSh[i]=iMA(NULL,0,Period_MAm,0,MODE_EMA,PRICE_WEIGHTED,i); 
   if ((MAbSh[0]>MAmSh[0] && MAbSh[i]>MAmSh[i]) ||(MAbSh[0]<MAmSh[0] && MAbSh[i]<MAmSh[i]))
      TrendCh[i]=true; 
   else TrendCh[i]=false;
//   if TrendCh[i-1]==TrendCh[i]
   return (true);
return (false);   
}
//+------------------------------------------------------------------+

Has anyone encountered the problem of the two MA trend change flag...? Got to this point and got stuck...

Any tips, pls! The idea is to write true in [bar shift] array when MA1> MA2 is done. then if all array is true - then flag is true.

 
100yan:

Has anyone encountered the problem of the two MA trend change flag...? Got to this point and got stuck...

Any tips, pls! The idea is to write true when MA1> MA2 is done in the [bar shift] array . then if the entire array is true - then the flag is true.


bool TrendChange(string smb, int tf, int Period_MAb, int Period_MAm, int nB)
{
  for (int i=0; i<nB; i++) 
  {
     double maB=iMA(smb, tf, Period_MAb, 0, MODE_EMA, PRICE_WEIGHTED, i);
     double maM=iMA(smb, tf, Period_MAm, 0, MODE_EMA, PRICE_WEIGHTED, i); 
     if (maA<maB) return(false);
  }
  return(true);   
}


//learn how to form the code