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 algospoke, Yesterday, 06:40 PM
      2 responses
      19 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      21 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X