[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 435

 
semiromid:

Help )

1.Instantaneous detection of a newly opened trade (not pending orders) (If the system has detected an order which was not opened earlier, it continues under number 2)

2. Any task is executed only once, just for this order.

After one more order is opened, the system acts again from point 1 to point 2

Need to find a manually placed order from the outside?
 
sergeev:

Service-Settings-International

Interesting. and the option appeared in the settings. this was not the case in earlier versions
 
bercut0077:
Good afternoon, could you tell me how to add an arrow (code 241) to a line of text and make it all look appropriate on the screen? For example -- > trend = StringConcatenate("Direction of trend: ", ? ? ? ?); Maybe there is another way?


Alternatively, you could use "quotation marks" and _underline_

or

^ up

...

 
peshihod:
Need to find a manually placed order from the outside?


Both manually and externally.

1.Моментальное определение вновь открывшегося торгового(не отложеных ордеров) ордера(Ордера открытого вручную и открытого спомощью советника) Если система определила ордер который рание не был открыт . то идет продолжение под номером 2.

2. Выполняеться какая то задача, всего 1-н раз,именно для этого ордера .

После того как еще открылся один ордер, система вновь действует с пункта 1 по пункт 2 .

 

forwarded to

semiromid:

if ( OrderSelect (77777, SELECT_BY_TICKET) == true)

How do I select a ticker that does not exist yet, but will be next?

 

moved to

semiromid:

Please help .

How can I add a variable to this "Error Occurred" comment ?

OrderSend(Symbol(),OP_SELLSTOP,0.1,Ask-50*Point,3,Bid+150*Point,Bid-150*Point, "An error occurred ", 0);


TheXpert:

OrderSend(Symbol(),OP_SELLSTOP,0.1,Ask-50*Point,3,Bid+150*Point,Bid-150*Point, "An error occurred "+GetLastError(), 0);

 

Good afternoon experts, in the indicator I am interested in the value received by the EA

SetIndexBuffer(2, Cur_Trend) которое в зависимости от обстоятельств должно иметь значение 1 или -1, все работает нормально, но по прошествии минут 10-15, значение выходит за 
рамки и становится сразу равно 2147483647, в чем здесь проблема, уже не один день бьюсь... выручайте, заранее спасибо!

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 LightBlue
#property indicator_color2 Magenta

double CrossUp[];
double CrossDown[];
double Cur_Trend[];
int CurrentTrend = 0;
int starttime = 0;

int init()
  {
   IndicatorBuffers(3); 
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);
   SetIndexBuffer(2, Cur_Trend);
   starttime = TimeLocal(); 
   
   return(0);
  }


int deinit()
  {
   return(0);
  }


int start() {
   
   int limit, i, counter, loop;
   
   double fasterEMAnow, slowerEMAnow, fasterEMAprevious, slowerEMAprevious, fasterEMAafter, slowerEMAafter;
   double Range, AvgRange;
   int counted_bars=IndicatorCounted();

   //---- check for possible errors
   if(counted_bars<0) return(-1);

   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;

   loop = 0;
   for(i = 0; i <= limit; i++) {
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      }
      Range=AvgRange/10;
       
      fasterEMAnow = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i);
      fasterEMAprevious = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i+1);
      fasterEMAafter = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i-1);

      slowerEMAnow = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_OPEN, i);
      slowerEMAprevious = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_OPEN, i+1);
      slowerEMAafter = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_OPEN, i-1);
      
      if ((fasterEMAnow > slowerEMAnow) && (fasterEMAprevious < slowerEMAprevious) && (fasterEMAafter > slowerEMAafter)) {
         CrossUp[i] = Low[i] - Range*0.5;
         if ((loop == 0) && (CurrentTrend != 1))  {
            CurrentTrend = 1;
            Cur_Trend[0]= CurrentTrend;
            }

         if (loop == 0)  {
            loop = 1;
            }
      }
      else if ((fasterEMAnow < slowerEMAnow) && (fasterEMAprevious > slowerEMAprevious) && (fasterEMAafter < slowerEMAafter)) {
            CrossDown[i] = High[i] + Range*0.5;
         if ((loop == 0) && (CurrentTrend != -1))  {
            CurrentTrend = -1;
            Cur_Trend[0]= CurrentTrend;
            }

         if (loop == 0)  {
            loop = 1;
            }
       }
   }
   return(0);
}
 

Hi all!

One more person decided to dive into EA programming)))

Please advise how to implement the timing of the EA, say from 0:00 to 0:15

Thanks in advance))))

 

Welcome to another plunging...

limit the running time of the advisor site:mql4.com

 
semiromid:


Both manually and from the outside.

1.Моментальное определение вновь открывшегося торгового(не отложеных ордеров) ордера(Ордера открытого вручную и открытого спомощью советника) Если система определила ордер который рание не был открыт . то идет продолжение под номером 2.

2. Выполняеться какая то задача, всего 1-н раз,именно для этого ордера .

После того как еще открылся один ордер, система вновь действует с пункта 1 по пункт 2 .


I.e. the moment of opening doesn't matter whether it was opened a minute ago or two?

Point 2 isn't clear. It's all a bit vague.

The opening time can be determined by OrderOpenTime().