Non scrolling trendlinies - EasyLanguage Programming | futures io social day trading
futures io futures trading


Non scrolling trendlinies
Updated: Views / Replies:117 / 1
Created: by TwoHands Attachments:1

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
 

Non scrolling trendlinies

  #1 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 114 since Apr 2011
Thanks: 97 given, 149 received

Non scrolling trendlinies

This is a repost from another thread because I forgot this thread existed. Duh.
___________________________


Got some code from one of the TradeStation coders on their forum but as a non-coder and failed tinkerer I don't know how to get this to where I want it. I added the inputs and variables to show the nine lines I want.

 
Code
#region - Documentation - 
{ 
--------------------------------------------------------------------------------------------------- 
IDENTIFICATION 
============== 
Name:			RightTLs 
Type:			Indicator 
TS Version:		9.5 Build 17 or later 
 
--------------------------------------------------------------------------------------------------- 
DOCUMENTATION 
============= 
This 9.5 sample indicator draws a trendline to the right of the current bar, extended to the right 
and shifts the starting point as new bars are added to the chart.  A label is also drawn abvoe the  
trendline. 
 
--------------------------------------------------------------------------------------------------- 
HISTORY 
======= 
Date		By		Version		Task 
---------	-------	--------	------------------------------------------------------------------- 
01/22/18	chrisd	01.00.00	* Created 
 								 
--------------------------------------------------------------------------------------------------- 
} 
#endregion 
 
using elsystem;   
using elsystem.collections;  
using elsystem.drawing;   
using elsystem.drawingobjects;  
using tsdata.common;  
 
inputs: 
	int iBarsToRight(2), 
	string iColorName("Green"), 
	double iLabelFontSize(9.5),
	Lab1("R2"),
	Lab2("R1"),
	Lab3("PP"),
	Lab4("S1"),
	Lab5("S2"),
	Lab6("Glo Hi"),
	Lab7("Glo Lo"),
	Lab8("Y Close"),
	Lab9("Today Open"),
	Val1 (0),
	Val2 (0),
	Val3 (0),
	Val4 (0),
	Val5 (0),
	Val6 (0),
	Val7 (0),
	Val8 (0),
	Val9 (0);
	 
	 
variables: 
	TrendLine TL(null), 
	TextLabel TX(null), 
	BNPoint BNP(null); 
 
  
method TrendLine CreateTL(int startBarNo,  
	double price,  
	string tlName, 
	Color MyColor )    
variables: TrendLine TL;   
begin   
	TL = TrendLine.Create( BNPoint.Create(startBarNo + MaxBarsBack - 1, price),   
						   BNPoint.Create(startBarNo + MaxBarsBack - 1 + 1, price));   
	TL.Lock = true;   
	TL.Color = MyColor;   
	TL.Weight = Weight.Weight1;  
	TL.Persist = true;   
	TL.ExtRight = true; 
	TL.Name = tlName; 
	return TL;   
end;  
 
method TextLabel CreateTextLabel(int startBarNo, 
	double price,  
	string txName, 
	string labelText,  
	Color MyColor)   
variables: TextLabel TxtLbl;   
begin   
	TxtLbl = TextLabel.Create(BNPoint.Create(startBarNo + MaxBarsBack - 1, Price), labelText);  
	TxtLbl.Lock = true;   
	TxtLbl.Color = MyColor;   
	TxtLbl.Persist = true;  
	TxtLbl.VStyle = VerticalStyle.Bottom;   
	TxtLbl.HStyle = HorizontalStyle.Left;   
	TxtLbl.Font = Font.Create( "Arial", iLabelFontSize );  
	TxtLbl.Name = txName;  
	return TxtLbl;   
end;  
 
if LastBarOnchartEx and TL = null then 
begin 
	TL = CreateTL(CurrentBar + iBarsToRight, Val1, Lab1, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val1, Lab1, string.Format("{0} {1}", Lab1, Val1), 
		Color.White); 
	DrawingObjects.Add(TX);	
	   
	TL = CreateTL(CurrentBar + iBarsToRight, Val2, Lab2, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val2, Lab2, string.Format("{0} {1}", Lab2, Val2), 
		Color.White); 
	DrawingObjects.Add(TX);	 
 
	TL = CreateTL(CurrentBar + iBarsToRight, Val3, Lab3, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val3, Lab3, string.Format("{0} {1}", Lab3, Val3), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	TL = CreateTL(CurrentBar + iBarsToRight, Val4, Lab4, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val4, Lab4, string.Format("{0} {1}", Lab4, Val4), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	TL = CreateTL(CurrentBar + iBarsToRight, Val5, Lab5, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val5, Lab5, string.Format("{0} {1}", Lab5, Val5), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	TL = CreateTL(CurrentBar + iBarsToRight, Val6, Lab6, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val6, Lab6, string.Format("{0} {1}", Lab6, Val6), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	TL = CreateTL(CurrentBar + iBarsToRight, Val7, Lab7, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val7, Lab7, string.Format("{0} {1}", Lab7, Val7), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	TL = CreateTL(CurrentBar + iBarsToRight, Val8, Lab8, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val8, Lab8, string.Format("{0} {1}", Lab8, Val8), 
		Color.White); 
	DrawingObjects.Add(TX);	 
	 
	 	TL = CreateTL(CurrentBar + iBarsToRight, Val9, Lab9, Color.FromName(iColorName)); 
	DrawingObjects.Add(TL); 
	TX = CreateTextLabel(CurrentBar + iBarsToRight, Val9, Lab9, string.Format("{0} {1}", Lab9, Val9), 
		Color.White); 
	DrawingObjects.Add(TX);	
	
//	Move right 
if BarStatus(datanum + 1) = 2 and TL <> null then 
begin 
	BNP = BNPoint.Create(CurrentBar + MaxBarsBack - 1 + iBarsToRight, (TL.StartPoint astype BNPoint).Price); 
	TL.SetStartPoint(BNP); 
	TX.SetPointValue(BNP); 
	BNP = BNPoint.Create(CurrentBar + MaxBarsBack - 1 + iBarsToRight + 1, (TL.StartPoint astype BNPoint).Price); 
	TL.SetEndPoint(BNP); 
end;
end;
The idea is to have levels show up on a chart with trendlines and labels that stay on the right side of the chart in the area defined by "space to the right" in the Format Window dialog box as in this pic…

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Ideally this would be done with ADE but I'm not even in coding kindergarden so I'm not gonna try. I don't mind manually entering my levels in the morning but I've run into two problems. Both were addressed by the TS coder but I don't have the knowledge or skill to implement them.

1. The display cuts off the trailing zeros from the value on the text label so it won't alway show the two decimal places I want.

TS answer: Rather than having the numeric value as the value utilized by a string.Format pass in a numtostr(price, 2) to force the price to have two decimal places. If you want to make the code be able to handle different symbols with different numbers of decimal places, declare an intrabarpersist variable name DecimalPlaces and then populate it as follows:

DecimalPlaces = NumDecimals(PriceScale);


2. As candles are added to the chart the trendlines scroll left and will eventually overlap the candles. The coder has a subroutine to prevent this but I don't know how to call it from each trendline

TS answer:The code at the bottom below the // Move Right needs to be expanded to move every line and every text label you added.

I'd be grateful is someone could dig into this and apply the changes I want.

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.


Reply



futures io > > > > > Non scrolling trendlinies

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
Scrolling through volume profile - and other Sierra questions DarkPoolTrading Sierra Chart 16 May 21st, 2014 10:39 PM
Scrolling/dragging chart to see off-screen info? chris777 NinjaTrader 2 December 18th, 2012 10:06 AM


All times are GMT -4. The time now is 02:04 AM.

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-23 in 0.06 seconds with 20 queries on phoenix via your IP 54.224.44.168