Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 arvidvanstaey, Today, 02:19 PM
    4 responses
    10 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    56 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    8 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    47 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X