Help, Problem in drawing Trend line at the Edges

 
Trapheal:

Please, am having difficulty drawing from the edge of the chart, how do I go about it for point 1 and point 2 in picture below. Thanks.

CHART_PRICE_MIN

Chart minimum

double r/o   modifier - subwindow number

CHART_PRICE_MAX

Chart maximum

double r/o   modifier - subwindow number

Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Examples of Working with the Chart
Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Examples of Working with the Chart
  • www.mql5.com
Examples of Working with the Chart - Chart Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov:

CHART_PRICE_MIN

Chart minimum

double r/o   modifier - subwindow number

CHART_PRICE_MAX

Chart maximum

double r/o   modifier - subwindow number

Thanks.

double p1/*Maximum price*/ and p2;// Minimum Price

void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
  {
        if(id==CHARTEVENT_MOUSE_MOVE)
        {
         p1 = ChartGetDouble(0, CHART_PRICE_MAX);
         p2 = ChartGetDouble(0, CHART_PRICE_MIN);   
         Print(p1, " ", p2);
        }
 }

                                

The value is relative to the current view, if you scroll back, the value changes. Am trying to get the new value with the new code above but it is not working.

Thanks.

Reason: