Shouldn't the ObjectGetValueByShift(trendlineName,1) return the value of the trendline at a specific Shift 1 ??
yes
maybe the conditions not met
or maybe the trendlineName isn't the right name
I've debugged the code and the trendlineName is correct.
The problem is that the price returned by ObjectGetValueByShift(trendlineName,1) is not at the Shift 1 (in relation to Time[0] ) , but in relation to anchor point 2.
Can anyone confirm ? Thanks.
Shouldn't the ObjectGetValueByShift(trendlineName,1) return the value of the trendline at a specific Shift 1 ??
Yes, it works as expected on my platform (build 670)
The problem is that the price returned by ObjectGetValueByShift(trendlineName,1) is not at the Shift 1 (in relation to Time[0] ) , but in relation to anchor point 2.
Anchor point 2 is static. I'm using build 670.
You can close the ticket, I've managed to resolve this issue with a linear regression function.
- ObjectGetvalueByShift() works correctly.
- None of the coordinates of a trend line are static.
- There is no need to move anchor points to extend the trend line use OBJPROP_RAY.
- The shift parameter is not relative to Anchor point 2. It is relative to Time[0].
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I'm coding an EA that opens Buy a Sell trades when the Price breaks the Trendline.
To do so, I'm comparing price values to trend line values. But I don't understand why it's not working.
Basically the conditions are
--> Buy
if(Close[1] < NormalizeDouble(ObjectGetValueByShift(trendlineName,1),Digits)
&& Close[0] > NormalizeDouble(ObjectGetValueByShift(trendlineName,0),Digits) )
--> Sell
if(Close[1] > NormalizeDouble(ObjectGetValueByShift(trendlineName,1),Digits)
&& Close[0] < NormalizeDouble(ObjectGetValueByShift(trendlineName,0),Digits)
Shouldn't the ObjectGetValueByShift(trendlineName,1) return the value of the trendline at a specific Shift 1 ??
Can anyone help me ? Thanks.