if((Ask>l1 && Ask<l2) || (Ask>l2 && Ask<l1))
Also i doubt need of NormalizeDouble
Like I said before that wont work if the lines are on an angle.
Say if two lines are parallel two each other and they are at an 45 degree angle , even if the price is outside the the two lines it will still say true.
I think I have to use this too ObjectGetShiftByValue
Say if two lines are parallel two each other and they are at an 45 degree angle , even if the price is outside the the two lines it will still say true.
I think I have to use this too ObjectGetShiftByValue
What I did before was try to detect if a price hits a trendline but that didnt want
to work.
if(Bid == l1)
I saw the price hitting that line many times but nothing happens.
if(Bid == l1)
I saw the price hitting that line many times but nothing happens.
try something like this:
if( Bid > lineValue-0.5*Point && Bid < lineValue+0.5*Point)
This gives a 1 pip range as a target, instead of an "equals" condition.
----
Use ObjectGetValueByShift() to get the value of a trendline at any specifed bar.
Thank you Phy!
Price could still "hop over" your range, I'd probably use if(Bid >=
upperLineValue) for the "hit" test
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I would like to know how it is possible to know if price is between two trend lines.
l1 = NormalizeDouble(ObjectGetValueByShift(1TrendName, 0), Digits);
l2 = NormalizeDouble(ObjectGetValueByShift(2TrendName,0),Digits);
if(Ask>l1 && Ask<l2)
This wont work if the two trendlines are at an angle.
Anyone know of a way todo this?
L.