Little question?

 

Hello

I Have Indicator That Calculate The Value Between 2 Moving Objects (Which Work Very Fine)

The Problem is This Value Does Not Update until A Tick Comes In ,  So I Found And Indicator That Calls A TickByClick It Do The Trick but Unfortunately

i Dont Have Its Code And I Cant Get It So I Try To Wrote One MySelf 

And I Did It

The Problem Is When i Click It Holds While I Am Holding And Don't Release Until I Release ,  So How To make The CHARTEVENT_CLICK Release


Here Is My Code

//+------------------------------------------------------------------+
//| ChartEvent function TickByClick                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,         // Event identifier  
                  const long& lparam,   // Event parameter of long type
                  const double& dparam, // Event parameter of double type
                  const string& sparam) // Event parameter of string type
  {
//--- the left mouse button has been pressed on the chart
   if(id==CHARTEVENT_CLICK)
     {
     OnInit();     
     }     
  }
  
//---------------------------------------------------------------------------  
 
Ahmed Mokhtar: I Have Indicator That Calculate The Value Between 2 Moving Objects (Which Work Very Fine.The Problem is This Value Does Not Update until A Tick Comes In

Why would you want the indicator to update when no tick comes in?

If no new tick has arrived, then there is no change in close price and there will be no change to the moving averages for the current bar.

 
Fernando Carreiro #:

Why would you want the indicator to update when no tick comes in?

If no new tick has arrived, then there is no change in close price and there will be no change to the moving averages for the current bar.

thank you  Fernando for replaying


There Is 2 horizontal lines objects i drag up and down

the position size calculator , calculate the difference between them to come up with the position size

this position size is wrote on a text object so i can see and use
this text object does not update on the screen until when a new tick comes in
so i need my click on the horizontal lines objects while i drag them update the text object with a new tick
 
Ahmed Mokhtar:

Hello

I Have Indicator That Calculate The Value Between 2 Moving Objects (Which Work Very Fine)

The Problem is This Value Does Not Update until A Tick Comes In ,  So I Found And Indicator That Calls A TickByClick It Do The Trick but Unfortunately

i Dont Have Its Code And I Cant Get It So I Try To Wrote One MySelf 

And I Did It

The Problem Is When i Click It Holds While I Am Holding And Don't Release Until I Release ,  So How To make The CHARTEVENT_CLICK Release


Here Is My Code

You must use the following code:

if(id==CHARTEVENT_OBJECT_DRAG &&( sparam=="your name object" || ....))

{

 OnInit(); 

}

 
Hadi Jalayer #:

You must use the following code:

if(id==CHARTEVENT_OBJECT_DRAG &&( sparam=="your name object" || ....))

{

}

Thank You  Hadi  for replaying


the clicking method is working the only problem is with the freeze

but ok i will try you way