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

 
AlexeyVik:

So, you want to see the date and time of candlestick and indicator readings?

A gimmick, but come on)

I can see the date and time of the candle as it is by hovering over it. Indicator readings of the time interval boundary where I am,

The number of days, etc., bars of the time interval and to its end (it is counted and shown in seconds).

Yes, and that I have by dates of quotes Time[0], Time[Bars-1].

I want to show them without unnecessary jerking).

 
vld:

A gimmick, but come on)

I can see the date and time of the candle as it is by hovering over it. Indicator readings of the time interval boundary where I am,

The number of days, etc., bars of the time interval and to its end (it is counted and shown in seconds).

Yes, and that I have by dates of quotes Time[0], Time[Bars-1].

So that without unnecessary jerking)


I don't get it, though it's not a gag, it's a surprise of incomprehension.
 

The start() function used to be of type int. Now it is void type. There is such a thing. It used to be convenient to quit the start() function if it failed. But now it is not so convenient. I took one of ancient owls, where you can see how I was writing before:

void OnTick()
{
//---
   if (gdt_lastBarTime != Time[0])      // Если открылся новый бар, отрабатываем требуемые действия
   {
      int signal = GetGeneralSignal();
   
      if (signal != SIGNAL_NO)
          if (!Trade(signal))
              return (0);
          
      // Блок управления позициями   
      for (int li_Ord = OrdersTotal()-1; li_Ord >= 0; li_Ord--)
      {
         if (!OrderSelect(li_Ord, SELECT_BY_POS)) continue;
         if (OrderMagicNumber() != ii_Magic) continue;
         if (OrderSymbol() != Symbol()) continue;
       
          SPos.gi_CurTicket = OrderTicket();
          SPos.gi_Type = OrderType();
       
          // Блок модификации ордеров       
          if (id_SL != 0 || id_TP != 0)
          {
             if (OrderStopLoss() == 0 && OrderTakeProfit() == 0)
             {
                OrdersModifyer (ticket);
             }
          }
          // Блок перевода ордеров в б.у.
          if (OrderStopLoss() <= gd_PriceBU)
          {
             if (OrderType() > 1) continue;
             MovingStopLossToBU();
          }
          // Блок траала открытых ордеров
          if (OrderStopLoss() > gd_PriceBU)
          {
             TrailingStop();
          }

          // Удаление просроченных отложенных ордеров
          if (OrderOpenPrice() < Time[0])
          {
             DeletePendingOrders();
          }
      }
      
      gdt_lastBarTime = Time[0];     // На текущем баре все необходимые действия..
                                     // .. успешно выполнены
   }
}

Basically, with thegdt_LastBarTime variable I control the opening of a new bar. It used to be different. I wrote it like this:

if (gdt_lastBarTime == Time[0]) return (0)

I was skipping any further operations. How is it more convenient to implement this now? Because there is no possibility to return any value. It turns out that if I entered the condition, whatever happens there, the function will get to the end and the gdt_lastBarTime variable will get a new value. The point is that sending requests to the terminal at each tick is not an option. Therefore we need to limit this case more accurately. And if the function cannot be quit, as, for example, with int or boolean function, it means that it will work anyway.

 
hoz:

The start() function used to be of type int. Now it is void type. There is such a thing. It used to be convenient to quit the start() function if it failed. But now it is not so convenient. I took one of ancient owls, where you can see how I was writing before:

Basically, with thegdt_LastBarTime variable I control the opening of a new bar. It used to be different. I wrote it like this:

I skipped any further operations. How is it more convenient to implement this now? Because there is no possibility to return any value. It turns out that if I entered the condition, whatever happens there, the function will get to the end and the gdt_lastBarTime variable will get a new value. The point is that sending requests to the terminal at each tick is not an option. Therefore we need to limit this case more accurately. And if the function cannot be quit, as, for example, with int or boolean function, it means that it will work anyway.

What is wrong withhaving no parameters?
 
evillive:
return without parameters is not satisfactory?
That's where I left off.
 

A question has arisen about the use of indicator buffers - let's say two buffers in a separate window are used to draw a histogram. The first one shows some nominal values and the second one shows peak values.
Is it possible to programmatically prohibit the use of the second buffer by external indicators (wizards, etc.), i.e. to use it only for displaying the required values on the chart, but not be visible to external indicators that are overlaid by the user on the chart?

 
atztek:

Is it possible to programmatically prohibit the use of the second buffer by external indicators (wizards, etc.), i.e. so that it is only used to display the required values on the chart, but not visible to external indicators that are overlaid by the user on the chart?

No. Anything that is visible can be programmatically read out.
 
TheXpert:
No. Anything that is visible can be programmatically counted.

I see.
Thank you!
 

Is it possible to create a two-dimensional array by setting the size of the second dimension to a variable instead of a constant?

 
tuner:

Is it possible to create a two-dimensional array by setting the size of the second dimension to a variable rather than a constant?


I don't know if this is what you need, but it is:

#define Name_Of_Variable   20

double   Array_Name[][Name_Of_Variable]
Reason: