Indicators: iForexSessions - page 5

 
      int copied=CopyHigh(Symbol(),PERIOD_H1,BrokerSessions[i][SYD].BeginBroker,BrokerSessions[i][NYC].EndBroker,high);
      if(copied<=0)
         continue;

      double low[];
      CopyLow(Symbol(),PERIOD_H1,BrokerSessions[i][SYD].BeginBroker,BrokerSessions[i][NYC].EndBroker,low);
            
      dayhigh=(high[ArrayMaximum(high)] + low[ArrayMinimum(low)]) / 2;


 
fxsaber #:
      int copied=CopyHigh(Symbol(),PERIOD_H1,BrokerSessions[i][SYD].BeginBroker,BrokerSessions[i][NYC].EndBroker,high);
      if(copied<=0)
         continue;

      double low[];
      CopyLow(Symbol(),PERIOD_H1,BrokerSessions[i][SYD].BeginBroker,BrokerSessions[i][NYC].EndBroker,low);
            
      dayhigh=(high[ArrayMaximum(high)] + low[ArrayMinimum(low)]) / 2;

Sessions recatngles get mixed with the candles!

I think, the current display is much better and more clear:


Edit:

I though about adding your display (the 1st screenshot) as an option via input parameters, but this has its draw backs also (e.g., with M1 timeframes, you have to resize the price chart sometimes).

What I meant by MQL limitation, is that you cannot resize the price axis from code unless you switch to the fixed scale mode for axis by ChartSetInteger(chart_ID,CHART_SCALEFIX,0,true).

I did not find another way to resize the price axis while mainatining the ability for auto-scale mode.

 

I did not like his idea for drawing the boxes coz it make the chart not so clean.

 
amrali #:

Sessions recatngles get mixed with the candles!

I myself use only the minimum timeframe, so I am forced to use such changes in the code.


I am sure that it can be improved so that there are as few intersections with bars as possible. But I myself am not ready to spend time on this.


Best the enemy of the good.

 

Forum on trading, automated trading systems and testing trading strategies

Indicators: iForexSessions

fxsaber, 2024.04.04 15:02

dayhigh=(high[ArrayMaximum(high)] + low[ArrayMinimum(low)]) / 2;

Perhaps a compromise solution would be to make it possible to change the value of such a coefficient with the mouse.

 
fxsaber #:

I myself use only the minimum timeframe, so I am forced to use such changes in the code.


I am sure that it can be improved so that there are as few intersections with bars as possible. But I myself am not ready to spend time on this.


Best the enemy of the good.

Thank you so much.

I appreciate you contibutions and detecting bugs in this indicator.

 
fxsaber #:

Perhaps a compromise solution would be to make it possible to change the value of such a coefficient with the mouse.

I think the optimal way is to emulate resizing the price axis as in post #15 using SendMessage(). But, I cannot figure out the appropriate message id to send.

I will implement this fix later, when I can figure out the window handle and message id.

Edit:

I tried ChartSetInteger(chart_ID,CHART_SCALEFIX,0,true) but is has a bug, the volume ticks get disappeared from the chart, they cannot be made visible again.

 
amrali #:

I think the optimal way is to emulate resizing the price axis

I will definitely disable this implementation in the code, because it interferes with the appearance of the usual graph.
 

Update 8 April 2024 - version 1.50

Updated the 'TimeZoneInfo' library to version 1.72

Forum on trading, automated trading systems and testing trading strategies

Libraries: Local Timezones and Local Session Hours

amrali, 2024.04.08 02:18

Update 8 April 2024 - version 1.72

Improved the performance of the library by at least 2-3x times. Now using StructToTime instead of StringToTime inside the GetNthSunday method.


 

Update 9 April 2024 - version 1.55

Updated the 'TimeZoneInfo' library to version 1.75

Forum on trading, automated trading systems and testing trading strategies

Libraries: Local Timezones and Local Session Hours

amrali, 2024.04.09 02:55

Update 9 April 2024 - version 1.75

Fixed potential issue in the calculation of the broker GMT offset during the Christmas holidays on GMT+0 brokers.