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

Indicator with Bollinger at Real Time

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

    Indicator with Bollinger at Real Time

    Hello everyone, I 'm trying to do an indicator that works to open , not closed bar bar , I need you at the time that the price touches the lower Bollinger band out an arrow downwards at the point that has touched the price the lower Bollinger band .

    The problem I have is that for example CrossAbove Below work well or if I want to make my system closed bar and check the previous bar etc etc. But I do not want to stick close to what I want is that when the price touches the lower Bollinger band comes a down arrow .

    I try this:


    if (getCurrentBid() == Bollinger(x,y).Lower[0])
    {
    DrawArrowDown(CurrentBar.ToString(), true, 0, GetCurrentBid(), Color.Fuchsia);
    }
    But this doesn't work

    ThankYou for Attention

    #2
    Hello fisagol,

    Just to clarify, you want to draw a down arrow when the current price touches the lower bollinger band in real time, is this correct?

    The code you have should work, though I would use the Close[0] price.

    Do you have CalculateOnBarClose set to false in your code?

    When testing this, are you testing in real time or historically?

    Have you added any prints to ensure that this condition is being checked in real time?

    For example:

    Print(string.Format("{0} | {1} == {2}", DateTime.Now.ToString(), GetCurrentBid(), Bollinger(x,y).Lower[0]));
    if (GetCurrentBid() == Bollinger(x,y).Lower[0])
    {
    DrawArrowDown(CurrentBar.ToString(), true, 0, GetCurrentBid(), Color.Fuchsia);
    }

    If the script is running in real time, you will get a print for every tick which will print the current bid price and bollinger price. Are you seeing the prints appear in real time?
    Can you post the output from the output window to your next post?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the answer, now I modified some things.

      I have CalculateOnBarClose in false, and when I testing this indicator I make with real time.
      When this morning I change the code to put CalculateOnBar..... to false, this has been the result.

      The main problem has been resolved, because now the arrow when price touches the Bollinger Bands.

      In another post I certainly will arise further questions , thank you very much for your attention the solution has been change to False the variable CalculateOnBarClose.... and keep my code with functions CrossAbove and CrossBelow.

      Sincerely JM.Fisa

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      149 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,283 views
      0 likes
      Last Post Leafcutter  
      Working...
      X