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

 
Viktorline14:

Thank you very much again!

Now there is one problem, the EA opens several orders in a row, not one as I wanted(

int start()



  { S1a = NormalizeDouble(iStochastic(NULL, 0, S1_period, 3, S1_slowing, MODE_SMA, 1, MODE_MAIN, 1), 0);

   S1b = NormalizeDouble(iStochastic(NULL, 0, S1_period, 3, S1_slowing, MODE_SMA, 1, MODE_SIGNAL, 1), 0);

   

   if(MyOrderStateB == 1)Sleep(300000);

    else MyOrderStateB = 0;

   if(MyOrderStateS == 1)Sleep(300000);

    else MyOrderStateS = 0;

    

 

     

   if(S1a == S1b && S1a<20.0000 && S1b<20.0000 )

 

      if(!OrderSend(Symbol(), OP_BUY, OrderValue, NormalizeDouble(Ask, Digits), Slippage, Bid - SL * Point, Ask + TP * Point, NULL, 0, 0,clrBlue))

   Print("Opening Buy error #", GetLastError());  

     else Sleep(2);

   MyOrderStateB = 1;

  

   


      

   if(S1a == S1b && S1a>80.0000 && S1b>80.0000 )


    

    

       if(!OrderSend(Symbol(), OP_SELL, OrderValue, NormalizeDouble(Bid, Digits), Slippage, Ask + SL * Point, Bid - TP * Point , NULL, 0, 0,clrRed))

       Print("Opening Sell error #", GetLastError()); 

       else Sleep(2);

       MyOrderStateS = 1;

       

      

       

       

       

   return(0);}


It goes something like this.

  int start()

     {
      S1a=NormalizeDouble(iStochastic(NULL,0,S1_period,3,S1_slowing,MODE_SMA,1,MODE_MAIN,1),0);
      S1b=NormalizeDouble(iStochastic(NULL,0,S1_period,3,S1_slowing,MODE_SMA,1,MODE_SIGNAL,1),0);

      if(S1a==S1b && S1a<20.0000 && S1b<20.0000 && MyOrderStateB==0)
         (
        if(!OrderSend(Symbol(),OP_BUY,OrderValue,NormalizeDouble(Ask,Digits),Slippage,Bid-SL*Point,Ask+TP*Point,NULL,0,0,clrBlue))
            Print("Opening Buy error #",GetLastError());
          else
            MyOrderStateB=1;
         )

      if(S1a==S1b && S1a>80.0000 && S1b>80.0000 && MyOrderStateS==0)
        {
       if(!OrderSend(Symbol(),OP_SELL,OrderValue,NormalizeDouble(Bid,Digits),Slippage,Ask+SL*Point,Bid-TP*Point,NULL,0,0,clrRed))
            Print("Opening Sell error #",GetLastError());
         else
            MyOrderStateS=1;
        }



      return(0);
     }
 
Hello, could you please tell me why push messages sometimes come with a delay? Today, after switching on the terminal, the messages came to my phone half an hour later. The internet was OK (the phone was close to my wifi). Most of the time, of course, everything happens without such delays. How can receiving push messages be made more stable?
 
halk2009:
Hello, could you please tell me why push messages sometimes come with a delay? Today, after switching on the terminal, the messages came to my phone half an hour later. The internet was OK (the phone was close to my wifi). Most of the time, of course, everything happens without such delays. How can receiving push messages be made more stable?
Did anyone guarantee instant messaging?
 
evillive:
Does anyone guarantee instant messaging?
I don't know) that's why I'm asking. Most of the time the messages come instantly, I just want it to be like that all the time!) Maybe there are some technical aspects that can be tweaked to increase the reliability of receiving push messages.
 
Guys, here's the rubbish. I put Playsound in the EA to play the sound during the signal, but my audio card started to twitch. That is, there is some kind of short-term sound, jerking. I switch off the terminal and everything is normal. The sound is playing the standard..... What can it be?
 
drknn:

I have seen some strange behaviour in the strategy tester. My EA sets and trawls pending stop orders. The following happens. The Expert Advisor sets a Buy Stop and Sell Stop at 30 pips from the current price (symbol - GbpUsd. Four digits. Minimal level = 3 pips). After a while it pulls them up following the market, if they didn't trigger. So what I see. the modification is successful, the modification is successful, and then at some point in time slams and error #1 pops up. That is, everything was fine, the EA was doing the same actions and suddenly this error pops up. All prices have been normalized to digits. In general, all values that are passed to the OrderModify() function input are normalized!

What can be the reason for such behavior of the EA in the tester?

An attempt to modify an order without changing values of any of its parameters. I would pay attention to non-strict comparisons by making them strict.
 

Good day!

Can you give me a hint? Can you use formulas to calculate or a reference...

How many pips on EURUSD should the price pass before stop out = 50%, 200 leverage is the broker's trading conditions on 1 lot. Margin call = 100%.

Thank you.

P.S. I know you need a point price. Hence the count from here...

 
_Roman:

Good day!

Can you give me a hint? Can you use formulas to calculate or a reference...

How many pips on EURUSD should the price pass before stop out = 50%, 200 leverage is the broker's trading conditions on 1 lot. Margin call = 100%.

Thank you.

P.S. I know you need a point price. Hence the count from here...


It's easier when the position has increased equity by 50% to count points! The difference in pips will be the same! ;))
 
borilunad:
It is easier, when the position has increased equity by 50%, to count points! The difference in pips will be the same! ;))

:-) There, the stop out is calculated as a percentage of the deposit amount...

Yes and there in the question I forgot to specify, for example, with $1000 on deposit.

 

On writing to an array, please advise.

The hitch. It is necessary to write fresh ticks times in amount, for example, 5 pcs. of ticks receipt into static array for calculation of average ticks/sec. for 5 ticks, for example.

I.e. write the arrival times of five ticks to the array. Then calculate the average tick/second rate.

How to shift the data in the array at every tick to record the time of the most recent tick coming into the terminal? How to fill a one-dimensional static array with tick arrival times? The indexing in the array is arranged as in the timeseries array. Can you suggest in text or code. I understand. Thank you.

It doesn't work that way. The array is not filled as needed with tick times.

int limit; //pBars;  
   int counted_bars=IndicatorCounted(); 
    //ArraySetAsSeries
 //---- последний посчитанный бар будет пересчитан
   if(counted_bars>0) counted_bars--;  
   limit=counted_bars;  
   for(int i=limit; i>=0; i--) { xBuffer[i+1] = xBuffer[i]; xBuffer_Time[i+1] = xBuffer_Time[i];}

   xBuffer[0] = iClose(symbol,1,0);
   xBuffer_Time[tickCounter_Current] = NormalizeDouble((iTime (_Symbol,1,0)-_start), 2); 
   tickCounter_Current ++;  
   tickCounter=tickCounter+1;
   
   if (tickCounter_Current == Num_Aver_of_Ticks)    
       tickCounter_Current = 0;   
       
   for ( i = 0; i < Num_Aver_of_Ticks; i ++) Summ_Time = Summ_Time + xBuffer_Time[i];
       
   if (Num_Aver_of_Ticks != 0)
   avgSpd = NormalizeDouble(Summ_Time / Num_Aver_of_Ticks, 2); 
Files:
Reason: