Code that displays only most recent Indicator (from right of chart) - futures io
futures io



Code that displays only most recent Indicator (from right of chart)


Discussion in TradeStation

Updated
    1. trending_up 773 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Code that displays only most recent Indicator (from right of chart)

(login for full post details)
  #1 (permalink)
Wsquare
Harrisburg, PA
 
 
Posts: 1 since Sep 2015
Thanks: 0 given, 0 received

I am trying to code a vertical line indicator {VL} so that it displays only the most recent SMA cross over rather than all of the crosses of the SMAs which might over the range of the chart. Below is an example of the code, I am going to code in a "loop" once I get get the placement of the VL correct. I do not understand why the placement is not working. Any guidance as to which function to use is much appreciated. Thank you very much!



Inputs: Line1(True), LineTime1(Close),
Line2(True), LineTime2(Average(Close,5));

Using elsystem;
using elsystem.drawing;
Using elsystem.drawingobjects;
Vars: VerticalLine VL(Null);

Method void DrawVerticalLine()
Begin
VL = VerticalLine.Create(BNPoint.Create(CurrentBar, Close));
VL.Persist = FALSE;
DrawingObjects.Add(VL);
End;

If LastBarOnChart then
Begin
If (Close > LineTime2) and (Close[1] < LineTime2[1]) then Begin
DrawVerticalLine();
DrawingObjects.Add(VL);
VL.Color = elsystem.drawing.Color.RED; // Upward Line
VL.Style = StyleType.solid;
VL.Weight = Weight.weight4;
End;

If (Close[1] > LineTime2[1]) and (Close[2] < LineTime2[2]) then Begin
DrawVerticalLine();
DrawingObjects.Add(VL);
VL.Color = elsystem.drawing.Color.CYAN; // Upward Line
VL.Style = StyleType.solid;
VL.Weight = Weight.weight4;
End;

If (Close[2] > LineTime2[2]) and (Close[3] < LineTime2[3]) then Begin
DrawVerticalLine();
DrawingObjects.Add(VL);
VL.Color = elsystem.drawing.Color.YELLOW; // Upward Line
VL.Style = StyleType.solid;
VL.Weight = Weight.weight4;
End;

End;

Attached Thumbnails
Click image for larger version

Name:	TS_OutputCode1.png
Views:	45
Size:	34.4 KB
ID:	193054   Click image for larger version

Name:	TS_OutputExample1.png
Views:	56
Size:	84.6 KB
ID:	193055  
Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > Code that displays only most recent Indicator (from right of chart)


Last Updated on September 16, 2015


Upcoming Webinars and Events

NinjaTrader Indicator Challenge!

Ongoing

Journal Challenge w/$1,800 in prizes!

May 7

The Cold Hard Truth: Maybe I Am Not Good Enough w/Chris Gray @ Earn2Trade

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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