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:300 / 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 90,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

Reply
 
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: 4 since Aug 2016
Thanks: 6 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.

 
Code
using elsystem.drawingobjects;
using elsystem.drawing;

vars:
	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");
	DrawingObjects.add(tl);
	mrh = tl;

I started out trying to simply move the existing line:

 
Code
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:

 
Code
                DrawingObjects.Delete(mrh);
		tl = TrendLine.create(BNPoint.create(BarNumber, high), bnpoint.create(99999, high));
		tl.Persist = true;
		tl.Color = color.fromname("red");
		DrawingObjects.add(tl);
		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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,658 since Apr 2013
Thanks: 250 given, 950 received
Forum Reputation: Legendary


greymatter,

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.

Regards,

ABCTG

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

Reply



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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Scott Hodson: Bitcoin and Cryptocurrency Trading Strategy

Elite only

Ran Aroussi: Python and Machine Learning (part 4) [special time 11AM ET]

Elite only
     

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


All times are GMT -4. The time now is 06:33 PM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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-04-20 in 0.08 seconds with 19 queries on phoenix via your IP 54.224.234.8