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 hdge4u, 04-29-2024, 12:23 PM
    5 responses
    28 views
    0 likes
    Last Post MisterTee  
    Started by llanqui, 01-25-2024, 06:15 PM
    9 responses
    64 views
    0 likes
    Last Post MisterTee  
    Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
    16 responses
    65 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
    55 responses
    5,463 views
    0 likes
    Last Post BartMan
    by BartMan
     
    Started by DawnTreader, 05-08-2024, 05:58 PM
    16 responses
    52 views
    0 likes
    Last Post DawnTreader  
    Working...
    X