NexusFi: Find Your Edge


Home Menu

 





need help with a plot in EasyLanguage with knowledge of ThinkScript


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one kidvic with 12 posts (0 thanks)
    2. looks_two Jura with 7 posts (4 thanks)
    3. looks_3 ABCTG with 3 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 9,661 views
    2. thumb_up 5 thanks given
    3. group 2 followers
    1. forum 22 posts
    2. attach_file 2 attachments




 
Search this Thread

need help with a plot in EasyLanguage with knowledge of ThinkScript

  #21 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


Jura View Post
Can you expand more on what the trend line drawn from right to left needs to do? Is that right-to-left trend line still drawn on the same bars and price coordinates? Or should that line be drawn on future, yet to form price bars? If so, how should that trend line be updated; extended further into the future or remain in place?

Btw, your current code draws a trend line on historical data and then extends it once on the next bar. Is that what you want it to do? I'm asking because this is something else than I understood from your previous posts in this thread, so there might be a misunderstanding here.

PS: a screenshot with your goal will probably speak more than words.

lets say I want to plot a trendline on bar number 10 ago to bar number 11. Now when I say 10 ago I mean last bar on chart (current bar that has not closed yet - 9) total 10, using currentbar in the last configuration will do the same, except counting from the 1st bar on chart up, and not last bar on chart down. , so the the other one should be( lastbaronchart - 10) It does not work this way.
Sorry, not at home right now.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #22 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

@Jura:
This is what I want to accomplish......

Reply With Quote
  #23 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


My interpretation of what you're trying to do is the following:

 
Code
Variables:
	tlID(0);
	
if (BarStatus(1) = 2) then begin

	if (tlID = 0) then begin
	
		// Create the trend line 10 & 11 bars ago
		tlID = TL_New_s(Symbol_Date[11], Symbol_Time_s[11], Symbol_Low[11],
			Symbol_Date[10], Symbol_Time_s[10], Symbol_High[10]);
			
		TL_SetColor(tlID, red);
		TL_SetSize(tlID, 2);
	
	end
	else begin
		
		// Now update the trend line so that bar 10 becomes 11,
		// which I guess means the line will always needs to be plotted
		// 10 bars ago from the current
		TL_SetBegin_s(tlID, Symbol_Date[11], Symbol_Time_s[11], Symbol_Low[11]);
		TL_SetEnd_s(tlID, Symbol_Date[10], Symbol_Time_s[10], Symbol_High[10]);	
	
	end;

end;
Which draws the line from High[10] to Low[11], and then updates the trend line on each bar so that the old bar 10 becomes the new bar 11. I'm not sure if this interpretation is correct, because I can also read your screenshot as meaning to say 'keep the trend line on the same bar'.

Here's what the above code looks like:



Then when the code updates, the trend line moves with it, reflecting the 'old bars' becoming 'new bars':


Reply With Quote




Last Updated on May 24, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts