• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LowestBar() function with up arrow for the candle

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

    LowestBar() function with up arrow for the candle

    Hi,


    Is it possible to locate the lowest low of the last 20 bars using the LowestBar() function ? If so, what would go between the parenteses?

    Also, if such a value is obtainable, is it possible to print an up arrow for that bar/candle?

    Thanks?

    #2
    Hi Marcusplexus,

    Thanks for the Post.

    It is possible to locate the lowest low of the last 20 bars using the LowestBar() Function. In the parentheses you will put the following in –
    • Any DataSeries type object such as an indicator, Close, High, Low, etc...
    • Period or number of bars to check for the condition
    • I.E. LowestBar(Low, 20)
    Using the DrawArrowUp() will allow you to place an up arrow for and at that lowest value Bar.
    In your OnBarUpdate(), you would place this code
    Code:
    DrawArrowUp("TheLowBar", true, LowestBar(Low, 20), Low[LowestBar(Low,20)] - TickSize, Color.Red);
    Click here for more info on DrawArrowUp()
    Click here for more info on LowestBar()

    Please let me know if I can be of further assistance
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Excellent! Thanks!

      Comment


        #4
        Hey @ll, i want to do the same with multiple timeframes

        I am so far:

        Print(Time[0].ToString());
        Print(Low[LowestBar(Low, 20)]);
        Print(MIN(Low, 20)[0]);
        Print(Lows[Timeframe][LowestBar(Low,20)]);

        DrawArrowUp("TheLowBar"+CurrentBar, true, LowestBar(Low, 20), Lows[Timeframe][LowestBar(Low,20)] - TickSize, Color.Red);

        and the arrows are looking good, BUT when I add this information into my StopSystem:

        -->
        SetStopLoss("Name",CalculationMode.Price, Low[LowestBar(Low, 96)] ,true);
        ---> this is working somehow and put the Stop at the lowest bar of the 96 Bars, right?

        But if I try to switch from 5min to 60min i need something like
        SetStopLoss("Name",CalculationMode.Price, Lows[Timeframe][LowestBar(Low,20)] ,true);
        dont I?
        --> most confusing --> I just allowed long trades but here i get short trades as well?!

        I hope you get what I want :-)
        Some kind of trailing depending on the low of the last 20 bars and working in multiple Timeframes.

        Comment


          #5
          Hi eNhale,

          This is mostly correct with one small error.

          When using an input source for the call to LowestBar, supply the Lows with the proper BarsArray index.

          For example:
          SetStopLoss("Name",CalculationMode.Price, Lows[1][LowestBar(Lows[1],20)] ,true);
          SetStopLoss("Name",CalculationMode.Price, Lows[Timeframe][LowestBar(Lows[Timeframe],20)] ,true);
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi ChelseaB,

            you made my day!
            Thank you for the super fast and 100% helping answer!!!!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Rashid Garuba, Today, 11:37 AM
            0 responses
            3 views
            0 likes
            Last Post Rashid Garuba  
            Started by elkhatabi, Today, 11:19 AM
            0 responses
            4 views
            0 likes
            Last Post elkhatabi  
            Started by hurleydood, Today, 10:07 AM
            0 responses
            5 views
            0 likes
            Last Post hurleydood  
            Started by Irukandji, Today, 09:43 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ThomasC  
            Started by TazoTodua, Today, 09:06 AM
            0 responses
            7 views
            0 likes
            Last Post TazoTodua  
            Working...
            X