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

 
Andrey-F:

I tried to write an owl but I don't know how to open an order inside of a minute bar, I couldn't find it in a manual, that's why I keep asking, I tried Sleep(30000), but it didn't work. Regards

Interesting state of affairs "writing an owl is no problem" but counting 30 seconds from the start of the minute is "an impossible task"...

Lift it up:

    datetime ldt_Time = iTime (Symbol(), 1, 0);
    if (TimeCurrent() - ldt_Time > 30)
    {/*Здесь делайте то, что Вам надо*/}
...You won't get any help from such owls. (from experience) :)))
 
Andrey-F:

I tried it with Sleep(30000), but it did not work. Regards
You should also remember that if the clock struck a new minute, on the M1 chart the candlestick may appear, for example at 15 seconds. At night the ticks are less frequent. Therefore, if the M1-candle is opened, in practice, the position may be opened at about 45 seconds.
 
paladin80:
It should also be remembered that if the clock is a new minute, a candlestick may appear on the M1 chart, e.g. at 15 seconds. Ticks are less frequent at night. So if we count up from the opening of the M1-cross, in practice the position will be opened at about 45 seconds, for example.


Thanks for the clarification, 45 seconds is better than the start of a new bar, especially if we are interested in the movement speed and we have to look for a bar anyway.
 

Good evening.

Regarding the inertia of ticks on different periods.

There shouldn't be any as the tick comes in real time one for all periods with the same

value of the new price. You can compare at M1 and M15 open at the same time or more along the ASK line. When you open a Buy/Sell order on M1 it will be 45 seconds, while on M15 at that moment

maybe 6 minutes and the same 45 seconds as on M1 at the same price.

 

Crossing of two lines - crossing = true. After crossing we need to wait for the current bar on M240 timeframe to end and when a new bar appears on M240 timeframe the signal = true.

      if(volMA12 - volMA11 > 0 && volMA21 - volMA22 > 0)      //если произошло пересечение на  ТФ15
         {                                                                                            
            пересечение = true;
            LastTime = iTime(NULL, 240, 0);            
            if(пересечение == true && Time(NULL, 240, 0)!=LastTime)
            {
               LastTime = iTime(NULL, 240, 0);               
                 сигнал = true;
;                           
            }                                                                                            
         }
Or is there a different and better way?
 

Hi all!

Please advise a script to open multiple orders according to parameters.

For example:

I want to open several buy orders with specified Stop Loss and Take Profit parameters, and immediately (i.e. simultaneously) several sell orders also with specified Stop Loss and Take Profit parameters.

Besides, the Stop Loss and Take Profit parameters can be set manually or, for example, a Stop Loss of +10 points from the opening price.

Thank you.

 
Hi, I want to ask: If I open a buy order on Friday with a stop of 20 pips, on Monday the market opens 30 pips below the stop loss, will the order close at the stop or what? )))) What time does it open? )))) Thank you!
 
Beowulf:
Hi, I want to ask: If I open a buy order on Friday with a stop of 20 pips, on Monday the market opens 30 pips below the stop loss, will the order close at the stop or what? )))) What time does it open? )))) Thank you!

Read the regulations of your broker/dealer, they are responsible for such issues.
 
Beowulf:
Hi, I want to ask: If I open a buy order on Friday with a stop of 20 pips, on Monday the market opens 30 pips below the stop loss, will the order close at the stop or what? )))) What time does it open? )))) Thank you!
It should close on a stop loss. Forex opens at 00:00 GMT.
 
Andrey-F:

I tried it with the Sleep(30000) function, but it did not work. Regards

I do understand it! It's enough to look to the left at the tick "dance". As for the rest, clever people have already and convincingly answered you what your undertaking is worth! Do not confuse trading with a game of wall-to-wall!
Reason: