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

 

Can you tell me how to organise a weekend skip when searching for a bar by time.

In the examples, we do all the calculations on daily charts, where 1 bar is 1 day.

For example, we have Time[0], and we need to find the time of five future bars that have not been formed yet. If you do Time[0] + 60 * Period * 5, then when you get to the weekend, the bars will not be calculated correctly.

 
sss2019:

Подскажите, как организовать пропуск выходных дней, при поиске бара по времени.

In the examples we do all calculations on daily charts, where 1 bar is 1 day.

For example, we have Time[0], and we need to find the time of five future bars that have not yet been formed. If you do Time[0] + 60 * Period * 5, then when you get to the weekend, the bars are not calculated correctly.

Fancy !!! Find future bars ! You don't happen to be writing a grail ??? How do you want to find something that hasn't been formed yet ????

If you didn't say it right.

Try using iTime(......) instead of Time[0].

Weekends can be defined with DayOfWeek() where 0 and 6 are weekends ....

 

Please advise if it is possible to prohibit the change of connections to the servers (as shown in the picture).

servers

 
VOLDEMAR:
sss2019:

Cool !!! Find future bars ! You don't happen to be writing a grail, do you? How do you want to find something that hasn't been formed yet ????

If you didn't say it right.

Try using iTime(......) instead of Time[0].

Weekends can be defined with DayOfWeek() where 0 and 6 are weekends ....


Used to do once, checked each bar functions if(iBarShift >= 0)

But now I forgot how to do it and got confused.

Print(input to function);

FindNexttime();

int FindNexttime()

{

Here is the work of this function

Print(FindNexttime);

}

But on startup it prints only the required time, and the phrase input to the function does not print, so glitches have started, and I couldn't figure it out

 

Good day!!!

I don't understand anything. I just even- fuh- sighed and sat for a long time, and in whose error, pouyuyaemu less and less!

OrderSelect ( tycc, SELECT_BY_TICKET );     Print( " PostayiliSellLot3 ", PostayiliSellLot3 , "   tycc " , tycc , "  OrderType() " , OrderType() );
if ( tycc>0&&PozyProstavleny&&!PostayiliSellLot3){if (OrderSelect ( tycc, SELECT_BY_TICKET ))
     { Print( " мі здесь  OrderSelect ");
         //---- Проверяем SELL этот ордер или нет
         if (OrderType()==SELL)
         {  Print( " мі здесь  rderType()==SELL "); 
             

Does not pass the second check! What's the position - sell!

2013.01.24 11:46:43 2007.11.09 18:32 Version_dynamic_with_understanding_Alex_WearwolfTry GBPUSD,H4: mi hereOrderSelect

2013.01.24 11:46:43 2007.11.09 18:32 Version_dynamic_with_understanding_Alex_Wearwolftry GBPUSD,H4: PostayiliSellLot3 0 tycc 22 OrderType() 1

2013.01.24 11:46:43 2007.11.09 18:32 Version_dynamic_with_understanding_Alex_Wearwolftry GBPUSD,H4: mi here OrderSelect

2013.01.24 11:46:43 2007.11.09 18:32 Version_dynamic_with_understanding_Alex_Wearwolftry GBPUSD,H4: PostayiliSellLot3 0 tycc 22 OrderType() 1

2013.01.24 11:46:43 2007.11.09 18:32 Tester: order #22, sell 2.00 GBPUSD is opened at 2.0911

2013.01.24 11:46:43 2007.11.09 18:32 Tester: order #22 to sell GBPUSD,H4: OrderSelect here

2013.01.24 11:46:43 2007.11.09 18:32 Version_dynamic_with_understanding_Alex_Wearwolftry GBPUSD,H4: PostayiliSellLot3 0 tycc 22 OrderType() 5


 

Help me! Needless to say, I realise that at some point in the code, I'm a sheep!

I don't know where!

 

I've come across designs like this:

The first situation:

while (!IsStopped())
   {
      while (!WaitForTradeContext()) {}
      CorrectionOfStops(type, sl, tp);
      if (OrderModify(ticket, 0, sl, tp, OrderExpiration()))
      {
         Comment("Стоп-приказ и профит успешно установлены!");
         return(true);
      }
      Sleep(1000);
   }
}

The OrderSend function has 0(zero) instead of the new opening price of the pending order, how should this be understood?

Second situation:

int ticket = OpenOrderWithInstantMode(type, lot, price, 0, 0, magicNumber);
   if (ticket <= 0)
      return(false);
    
   if (!OrderSelect(ticket, SELECT_BY_TICKET) || 
       OrderCloseTime() != 0)   
   {
      Alert("Фатальная ошибка при установке стопов и профитов нового ордера!");
      return(false);
   }

HereOrderCloseTime() != 0 by logic should not refer to the order which is selected with function OrderSelect sincethere is operator || between them, not brackets, for example. Please explain this point to .

 
The hell he knows, but where isOrderSend? There'sOrderModify! Zero must be the price staying the same!
 
hoz:

The second point:

HereOrderCloseTime() != 0 should not logically apply to the order selected by the OrderSelect function, because there is a || operator between them, not brackets, for example. Please clarify this point to .


To avoid compiler optimization this construct is incorrect,

because it is unknown what will be checked first - OrderSelect or OrderCloseTime

 
Help! The case is not moving.
Reason: