Trendline Question: How to detect when the price breaks TL
-
Hello FxDreema!
Thank you always for taking time to answer questions!
I am just experimenting with trendlines.
I want the EA to comment when the price breaks above the trendline; Above Trendline.
When the price is below the TL, it should comment; below Trendline.I am having problems configuring how the EA detects when the price moves above the trendline and wondered if you could help me.
Here is a shared weblink.
http://fxdreema.com/shared/e92SlWhzbBest Regards,
-
In this EA you detect whether the price is above or below the trendline, and it works... no matter if one of both comment messages is not edited.
To detect when it breaks is another story. This means that the price is going from below to above or from above to below. So I can suggest to use crossover: http://fxdreema.com/shared/2HwDQrbAb
By the way I found a little problem using in objects category in Condition when using it this way and I fixed it, so use this example on the web version because it will probably don't work on the local one at the moment. -
__In this EA you detect whether the price is above or below the trendline, and it works... no matter if one of both comment messages is not edited.
To detect when it breaks is another story. This means that the price is going from below to above or from above to below. So I can suggest to use crossover: http://fxdreema.com/shared/2HwDQrbAb
By the way I found a little problem using in objects category in Condition when using it this way and I fixed it, so use this example on the web version because it will probably don't work on the local one at the moment.[/quote:lnb6ru4z]Hi thanks! The web version was very helpful!
I have another question regarding TL.
There are 2 points in TL. Point 1 and Point 2.
Is it possible to change point 2 of the trendline when the high/low of the candle goes through the trendline but the closed price of the candle remains within the trendline?
If so, which block can I use to redraw or to re-define point 2?Regards,
-
Well, it is possible in MQL4/MQL5 using ObjectSet function, but I was not added this in fxDreema. I don't know when will I work on objects again (now I work on documentation), but you can try http://docs.mql4.com/objects/objectset
Something like...ObjectSet("MyTrendlineName", OBJPROP_PRICE2, 1.2345);or with first checking if the objects exists:
string name="MyTrendlineName"; if (ObjectFind(name)<0) {return(0);} ObjectSet(name, OBJPROP_PRICE2, 1.2345); -
Thanks for your help!
I haven't tested it out yet but I will do so in the near future!
Thanks again!

-
Really helpfull thanks