NexusFi: Find Your Edge


Home Menu

 





How to extend the end point of a line drawn with DrawLine


Discussion in NinjaTrader

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




 
Search this Thread

How to extend the end point of a line drawn with DrawLine

  #1 (permalink)
 trader789 
Philadelphia PA
 
Experience: Intermediate
Platform: ts
Trading: es
Posts: 7 since Feb 2011
Thanks Given: 2
Thanks Received: 3

On each new bar I check for a condition and if true I start a new line
also on each new bar I extend any previous lines

protected override void OnBarUpdate()
{
if (CurrentBar != previousBar)
{
if (somecondition)
{
DrawLine(tag, true, 0, price, 0, price, Color.Green, DashStyle.Dash, 3);
}

foreach (IDrawObject o in DrawObjects)
{
ILine line = o as ILine;
if (line != null) line.EndBarsAgo = 0;
// if (line != null) line.EndTime = Time[0];
}
.
.
.
previousBar = CurrentBar; // previousBar is an instance class variable
}
}

This works up to a certain point but then after that point the lines stop extending.
Is this a bug in Ninja Trader? Do I need to set line.EndTime = Time[0] instead of or in addition to line.EndBarsAgo = 0?

Thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
use extra computer for optimisation
NinjaTrader
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
 
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426



trader789 View Post
This works up to a certain point but then after that point the lines stop extending.
Is this a bug in Ninja Trader? Do I need to set line.EndTime = Time[0] instead of or in addition to line.EndBarsAgo = 0?

Thanks

Any reason why you can't use 'DrawRay' ? Only need to draw each one once then.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on December 22, 2014


© 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