ObjectGetValueByShift() returns 0 on Pitchfork

 

MQL4

I can get ObjectGetDouble(chart_ID,name,OBJPROP_PRICE1,0);  for the 3 data points, but I can not get the current pitchfork values ( index 0 )


When I hover the mouse over the lines , I get the actual values, so how can we get the values by code?



Can we get the line values in mql5?

ObjectGetValueByShift()  doesn't exist in mql5 and only has ObjectGetValueByTime ,

 
A PitchFork Price function to return price at any point and deviation from median available for general use
A PitchFork Price function to return price at any point and deviation from median available for general use
  • 2012.07.13
  • www.mql5.com
UPDATE - Apologies I have now found a bug in the deviation line calculation. In the process of rectifying it now...
 

poorly written code with zero divide error from not checking for "0" values before dividing.


I will rewrite the function and share once I test it.

 
torytory:

poorly written code with zero divide error from not checking for "0" values before dividing.


I will rewrite the function and share once I test it.

I didn't look at the code, just put in the link in case it was useful.

Reason: