Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am using trend lines to mark horizontal price levels. What I want to do is mark local highs and lows from the bar where they originate all the way to the right edge of the chart. So I mark the level but then want to move the line up for highs or down for lows when a slightly higher high or lower low is discovered.
I started out trying to simply move the existing line:
For some reason, that does not work. Any idea why not? It seems like it should.
Plan B was to delete the existing line and create a new line at the new level:
This code also behaves very strangely. If I run it as is, my print statements show that it is processing the code, yet it never deletes the original line, and it never creates new lines.
However, if I comment out the line that says DrawingObjects.Delete(mrh);, then I get all the lines. (To be clear, all I want is the most extreme high and low, not all of the interim steps on the way to them.)
There must be something I do not understand about the references to these drawing objects. Is the problem that I am reusing the variables tl and mrh and mrl? Am I forced to create a new variable for each line? Or is there some other problem that I completely missing?
It almost seems like the lines are not executed in the order that they appear, as if the lines are being drawn and then instantly deleted. So with the call to Delete() commented out, the drawn lines remain.
Any insights appreciated!
Can you help answer these questions from other members on NexusFi?
EndPoint and StartPoint are read only. Although the help states StartPoint.Price is get/set, it might be just be a mistake in the help. You can use the SetStartPoint and SetEndPoint methods of the trendline class instead to update the location.