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,434 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?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #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,425



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