need help with a plot in EasyLanguage with knowledge of ThinkScript - EasyLanguage Programming | futures io social day trading
futures io futures trading


need help with a plot in EasyLanguage with knowledge of ThinkScript
Updated: Views / Replies:2,339 / 22
Created: by kidvic Attachments:2

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
 2  
 
Thread Tools Search this Thread
 

need help with a plot in EasyLanguage with knowledge of ThinkScript

  #11 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


ABCTG View Post
kidvic,

if you always want the trendline to mark the high three candles ago you'll have to update the trendline location every bar.
Look up TL_SetBegin and TL_SetEnd in the Tradestation help. This will show you how to change the start and end points for a trendline.

Regards,
ABCTG

Still not working as I've updated the code with your help:

vars: TLID (High[3]), IntraBarPersist alreadyPlotted(false);

if (alreadyPlotted = false) then begin

TLID = TL_New( Date[3], Time[3], High[3], Date, Time, High[3] ) ;
TL_SetExtRight( TLID, true ) ;
TL_SetExtLeft( TLID, true ) ;
TL_SetBegin (TLID, Time[3], High[3], High[3]);
TL_SetEnd (TLID, Time[3], High[3], High[3]);


alreadyPlotted = true;

end;
......................That code still produces the wrong bar to draw a trendline one.

Reply With Quote
 
  #12 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,527 since Apr 2013
Thanks: 229 given, 853 received
Forum Reputation: Legendary

You placed the the location update inside the check that is only executed once to draw the trendline. Also compare the start and end point used for drawing the trendline with what you are using for the location update.

Regards,
ABCTG


kidvic View Post
Still not working as I've updated the code with your help:

vars: TLID (High[3]), IntraBarPersist alreadyPlotted(false);

if (alreadyPlotted = false) then begin

TLID = TL_New( Date[3], Time[3], High[3], Date, Time, High[3] ) ;
TL_SetExtRight( TLID, true ) ;
TL_SetExtLeft( TLID, true ) ;
TL_SetBegin (TLID, Time[3], High[3], High[3]);
TL_SetEnd (TLID, Time[3], High[3], High[3]);


alreadyPlotted = true;

end;
......................That code still produces the wrong bar to draw a trendline one.


Reply With Quote
 
  #13 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received



ABCTG View Post
You placed the the location update inside the check that is only executed once to draw the trendline. Also compare the start and end point used for drawing the trendline with what you are using for the location update.

Regards,
ABCTG

Not following what you mean.
The location is the high of 3 candles ago, I've referenced it many times so that it knows the candle i'm talking about.

Reply With Quote
 
  #14 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


kidvic View Post
Not following what you mean.
The location is the high of 3 candles ago, I've referenced it many times so that it knows the candle i'm talking about.

As I understand it, ABCTG means that you shouldn't put the location update in the code block that's only executed once (i.e., when `alreadyPlotted` is false). That probably makes sense when you think about it.

If you want to update the trend line on the close of each bar (for example), you can do as follows:

 
Code
Variables: 
  TLID (High[3]), 
  IntraBarPersist alreadyPlotted(false);

// Only draw the trend line once when
// `alreadyPlotted` is false
if (alreadyPlotted = false) then begin

  TLID = TL_New( Date[3], Time[3], High[3], Date, Time, High[3] ) ;
  TL_SetExtRight( TLID, true ) ;
  TL_SetExtLeft( TLID, true ) ;

  alreadyPlotted = true;

end;

// Then update the location of the trend line on
// the close of each bar
if (BarStatus(1) = 2) then begin

  TL_SetBegin (TLID, Time[3], High[3], High[3]);
  TL_SetEnd (TLID, Time[3], High[3], High[3]);

end;
But if I make a suggestion Kidvic, perhaps it's wise to rethink what you're actually want to make. Because the code we're helping you now with has little to do with your question that started this thread.

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #15 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


Jura View Post
As I understand it, ABCTG means that you shouldn't put the location update in the code block that's only executed once (i.e., when `alreadyPlotted` is false). That probably makes sense when you think about it.

If you want to update the trend line on the close of each bar (for example), you can do as follows:

 
Code
Variables: 
  TLID (High[3]), 
  IntraBarPersist alreadyPlotted(false);

// Only draw the trend line once when
// `alreadyPlotted` is false
if (alreadyPlotted = false) then begin

  TLID = TL_New( Date[3], Time[3], High[3], Date, Time, High[3] ) ;
  TL_SetExtRight( TLID, true ) ;
  TL_SetExtLeft( TLID, true ) ;

  alreadyPlotted = true;

end;

// Then update the location of the trend line on
// the close of each bar
if (BarStatus(1) = 2) then begin

  TL_SetBegin (TLID, Time[3], High[3], High[3]);
  TL_SetEnd (TLID, Time[3], High[3], High[3]);

end;
But if I make a suggestion Kidvic, perhaps it's wise to rethink what you're actually want to make. Because the code we're helping you now with has little to do with your question that started this thread.

Jura, the HighestALL function was resolved when you suggested the tl_new and extensions to left, and right. The example you saw was so you can see what I mean when I meant a HORIZONTAL line. (the condition was an example that created the horizontal line)
This last script you posted worked perfect alone, however when I introduced it to my script I ran into a few problems.

I think the best way to go about it now is to maybe actually call a barNumber. I have tried but I failed.
I have used the MaxBarsBack function, but I think I might be using it wrong. Also, I see a function called LastBarOnChart, but as I'm a noob programmer, I might be interpreting the syntax wrong.
I thought I might use (LastBarOnChart - 3) but that doesn't seem to work either.
I continue to try different ways, but It doesn't seem to work.


Last edited by kidvic; May 20th, 2015 at 03:55 AM. Reason: Found other problems
Reply With Quote
 
  #16 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


kidvic View Post
This last script you posted worked perfect alone, however when I introduced it to my script I ran into a few problems.

I think the best way to go about it now is to maybe actually call a barNumber. I have tried but I failed.
I have used the MaxBarsBack function, but I think I might be using it wrong. Also, I see a function called LastBarOnChart, but as I'm a noob programmer, I might be interpreting the syntax wrong.
I thought I might use (LastBarOnChart - 3) but that doesn't seem to work either.
I continue to try different ways, but It doesn't seem to work.

Can you clarify what you're trying to achieve now? It's not very clear to me, sorry. Why would you like the use the bar number for example?

Reply With Quote
 
  #17 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


Jura View Post
Can you clarify what you're trying to achieve now? It's not very clear to me, sorry. Why would you like the use the bar number for example?

Because as I've introduced the Above code into my script And it's really really slow. Also removing the trendline to the left does not remove it. Using current bar Plots a trend line on that bar.

Reply With Quote
 
  #18 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


kidvic View Post
Because as I've introduced the Above code into my script And it's really really slow. Also removing the trendline to the left does not remove it. Using current bar Plots a trend line on that bar.

Could you post the code that you are using now? Then we can take a look at it. If it's proprietary, can you create a code example that replicates this problematic behaviour?

Reply With Quote
 
  #19 (permalink)
Trading for Fun
Los Angeles, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader, ThinkOrSwim
Favorite Futures: Options, Futures
 
Posts: 92 since Mar 2015
Thanks: 13 given, 2 received


Jura View Post
Could you post the code that you are using now? Then we can take a look at it. If it's proprietary, can you create a code example that replicates this problematic behaviour?

 
Code
Var: TL_ID(-1);
if (CurrentBar = 10)
 then begin
 TL_ID = TL_New(Date, Time, High, Date, Time, Low);
end;
if (CurrentBar = 11)
 then begin
 TL_SetEnd(TL_ID, Date, Time, Low);
end;
Currentbar draws at bar 10 from left to right, how about from right to left?

Reply With Quote
 
  #20 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



kidvic View Post
 
Code
Var: TL_ID(-1);
if (CurrentBar = 10)
 then begin
 TL_ID = TL_New(Date, Time, High, Date, Time, Low);
end;
if (CurrentBar = 11)
 then begin
 TL_SetEnd(TL_ID, Date, Time, Low);
end;
Currentbar draws at bar 10 from left to right, how about from right to left?

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.

Reply With Quote

Reply



futures io > > > > > need help with a plot in EasyLanguage with knowledge of ThinkScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
ATR Trailing Stop: Convert Thinkscript to Easylanguage kamisyed MultiCharts 7 March 31st, 2017 06:13 PM
Easylanguage: Function to Plot Text Verticaly nunoonline EasyLanguage Programming 2 December 22nd, 2010 06:17 AM
does this road to knowledge sound ok? micksta Beginners and Introductions 5 March 17th, 2010 02:13 AM
Does having some trading knowledge get in the way? shodson Psychology and Money Management 4 March 9th, 2010 04:27 PM
improve and train your knowledge wh Psychology and Money Management 0 September 12th, 2009 05:19 PM


All times are GMT -4. The time now is 10:19 AM.

Copyright © 2017 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 2017-12-12 in 0.13 seconds with 20 queries on phoenix via your IP 54.90.92.204