Strange behavior when trying to move trendlines - EasyLanguage Programming | futures io social day trading
futures io futures trading


Strange behavior when trying to move trendlines
Updated: Views / Replies:405 / 2
Created: by greymatter Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Strange behavior when trying to move trendlines

  #1 (permalink)
Elite Member
Johns Creek GA/USA
Futures Experience: Intermediate
Platform: ThinkorSwim, IB
Favorite Futures: Emini ES
Posts: 6 since Aug 2016
Thanks: 7 given, 0 received

Strange behavior when trying to move trendlines

I am an experienced developer but new to EL.

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.

using elsystem.drawingobjects;
using elsystem.drawing;

	TrendLine tl(null),        // reusable variable
	TrendLine mrh(null),    // reference to most recent high TL
	TrendLine mrl(null);     // reference to most recent low TL


        // create an initial price level line
	tl = TrendLine.create(BNPoint.create(BarNumber, high), bnpoint.create(99999, high));
	tl.Persist = true;
	tl.color = color.fromname("red");
	mrh = tl;

I started out trying to simply move the existing line:

mrh.StartPoint.Price = High;
mrh.EndPoint.Price = High;
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:

		tl = TrendLine.create(BNPoint.create(BarNumber, high), bnpoint.create(99999, high));
		tl.Persist = true;
		tl.Color = color.fromname("red");
		mrh = tl;
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!

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Hamburg Germany
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
Posts: 1,846 since Apr 2013
Thanks: 301 given, 1,130 received
Forum Reputation: Legendary


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.



Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io > > > > > Strange behavior when trying to move trendlines

Upcoming Webinars and Events (4:30PM ET unless noted)

Fundraiser: Feeding Families in Need (ends Dec 17)


How to use the Footprint Tool to Execute Trades w/Brannigan Barrett

Elite only

Ask Me Anything (Brokers & Platforms) w/Ilan Levy Mayer @ Cannon Trading

Dec 13

Battlestations! Show us your trading desks w/GFF Brokers ($750 in Prizes)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange NYSE Tick Behavior MedianVelocity Emini Index Futures Trading 7 April 29th, 2016 04:04 AM
High/Low for Time Period Strange Behavior Tiger45 Sierra Chart 1 April 29th, 2016 04:02 AM
Ninjatrader 7 - strange Market Replay behavior / data felix1988 NinjaTrader 3 August 11th, 2014 12:45 PM
Self destructive behavior action47288 Elite Trading Journals 13 October 28th, 2013 02:56 PM
Strange Indicator Behavior: Newbie Question/Help! ToddPMan NinjaTrader Programming 2 March 14th, 2013 11:02 AM

barnumber, code, delete, dow, easylanguage, es, information, multicharts, neoticker, tradestation, trend, trend lines, trendline, trendlines, update

All times are GMT -4. The time now is 03:51 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2018-12-11 in 0.09 seconds with 15 queries on phoenix