[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 70

 

Good afternoon! Can you tell me how to remember the time of the MA crossing?

Is it the right move?

   datetime up;

   if (iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0) >                                             
       iMA(NULL,0,33,0,MODE_SMA,PRICE_CLOSE,0))
       {
   up=iTime(NULL,0?????????????????
       }
 
Arles:

Good afternoon! Can you tell me how to remember the time of the MA crossing?

Is it the right move?


You don't have a crossover... but the fact that one is higher than the other. Determine the bar at which the crossing occurred, and then you get the time from the bar (Time[bar number]), or iTime()
 
artmedia70:

You don't have a crossover here...but the fact that one is higher than the other. Determine the bar where the crossing occurred, and from the bar you can find out the time (Time[bar number]), or iTime()

OK, then:

   datetime up;

   if ((iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0) >                                             
        iMA(NULL,0,33,0,MODE_SMA,PRICE_CLOSE,0)) &&
       (iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,1) <                                             
        iMA(NULL,0,33,0,MODE_SMA,PRICE_CLOSE,1)))
       {
   up=iTime(NULL,0?????????????????
       }
I don't know what to do further!!!!!!
 
Arles:

All right, then:

I don't know what to do next!!!!!!



   datetime up;

   if ((iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0) >                                             
        iMA(NULL,0,33,0,MODE_SMA,PRICE_CLOSE,0)) &&
       (iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,1) <                                             
        iMA(NULL,0,33,0,MODE_SMA,PRICE_CLOSE,1)))
       {
   up=iTime(NULL,0,0);  //?????????????????
       }
 
r772ra:

And up will remain the time of the crossing?

If so, how do we now know the number of bars after the time before this crossing?

iBarShift(NULL,0,up)
will return the number of bars?
 
Heroix:


what kind of wild condition is that?! :)

Write this operator in Russian, I'll try to fix the line.


if(total >=-1 && total ==Orders(symbol,operation,magic)) if there is an open order and the open order is not opened by this EA then....
 
Arles:

And up will remain the time of the crossing?

If so, how do we now know the number of bars after the time before this crossing?

will return the number of bars?


Yes. But, not the number of bars, but the bar at which it was crossed!!!
 
r772ra:

Yes. But, not the number of bars, but the bar at which it was crossed!!!
And how do you find out the number of bars before this crossing afterwards?
 
Arles:
How do I know the number of bars before this crossing then?



if(iBarShift(NULL,0,up)>=3) // на 3 баре было пересечение
     {
      //что-то делаем, к примеру OrderSend();
     }
 

There is a lot of talk about high-frequency trading. They say HFT beats them all. What is its principal advantage over us? The fact that a short ping is a good thing in itself is understandable, but it takes more than a millisecond to make a trade :) What new quality appears in HFT and how do the algorithms differ in principle?

Thank you.

Reason: