CurrentDayOHLC().CurrentLow[0] + (CurrentDayOHLC().CurrentHigh[0] - CurrentDayOHLC().CurrentLow[0])
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Draw Line
Collapse
X
-
Draw Line
I am trying to draw a line using the following formula (Midpoint). It should start at the beginning of the session and run to current adjusting along the way. I looked at Draw.Line but am getting errors. Any help would be appreciated. Thank you.
CurrentDayOHLC().CurrentLow[0] + (CurrentDayOHLC().CurrentHigh[0] - CurrentDayOHLC().CurrentLow[0])
Tags: None
-
Hello EthanHunt,
Thank you for your post.
I would suggest assigning that calculation to a Plot:
Here's a quick example:
Code:private CurrentDayOHL CurrentDayOHL1; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "AddAPlot"; Calculate = Calculate.OnBarClose; IsOverlay = true; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = true; AddPlot(Brushes.Orange, "MyPlot"); } else if (State == State.DataLoaded) { CurrentDayOHL1 = CurrentDayOHL(); } } protected override void OnBarUpdate() { Value[0] = CurrentDayOHL1.CurrentLow[0] + (CurrentDayOHL1.CurrentHigh[0] - CurrentDayOHL1.CurrentLow[0]); } #region Properties [Browsable(false)] [XmlIgnore] public Series<double> MyPlot { get { return Values[0]; } } #endregion
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
-
Hello EthanHunt,
Thank you for your reply.
That would be because I used your calculation, which simply subtracts the low from the high and then adds it again to the high, leaving you with a value equal to the high. You can absolutely adjust the calculation however you like.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,290 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
||
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
9 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
11 responses
62 views
0 likes
|
Last Post Today, 10:08 AM | ||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
8 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
25 views
0 likes
|
Last Post Today, 09:41 AM |
Comment