Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 How to get Higher highs of a specific dataseries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    this code( see below) gets the highs and lows from a starter point ( Volume[0]>XVolume). what I'm trying to get is just current highsof ( Volume[0]>XVolume) serie...


    else if (State == State.Configure)
    {oVolume= new Series<double>(this);
    oHigh= new Series<double>(this);
    othv = new Series<double>(this);
    CurrentHigh = new Series<double>(this);
    currentHigh = double.MinValue;
    xVolume=100;
    sessionIterator = null;
    currentDate = Core.Globals.MinDate;
    }
    }

    protected override void OnBarUpdate()
    {if (!Bars.BarsType.IsIntraday)
    {
    Draw.TextFixed(this, "NinjaScriptInfo", Custom.Resource.CurrentDayOHLError, TextPosition.BottomRight);
    return;
    }

    if (sessionIterator == null)
    sessionIterator = new Data.SessionIterator(BarsArray[0]);

    bool sameDay = true;
    if (currentDate == sessionIterator.GetTradingDay(Time[0]))

    if(Volume[0]>XVolume)
    {
    // oVolume[0]=Volume[0];
    currentHigh=High[0];

    Draw.ArrowUp (this, "f" + CurrentBar , true, 0, Low [0], new SolidColorBrush( Colors.Orange ));
    Print(""+currentHigh.ToString());
    sameDay = false;
    }
    currentHigh = Math.Max(currentHigh, High[0]);

    if(ShowHigh)
    {
    if ( !PlotCurrentValue || currentHigh != High[0])

    {CurrentHigh[0] = currentHigh;
    Print(""+currentHigh.ToString()+"/"+Time[0].ToString());
    Draw.ArrowUp (this, "f" + CurrentBar , true, 0, Low [0], new SolidColorBrush( Colors.Red ));}

    else
    { for (int idx = 0; idx < CurrentBar - 1; idx++)
    CurrentHigh[idx] = currentHigh;
    Print("xxxxxxx"+Time[0].ToString());}
    Last edited by zteck; 01-06-2017, 11:03 AM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    139 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X