• 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

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 Captain_Qwark, Today, 10:55 AM
      3 responses
      19 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by kmpc1, Today, 11:03 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by jransom, Today, 09:08 AM
      1 response
      19 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by mtamaku, Today, 09:19 AM
      0 responses
      23 views
      0 likes
      Last Post mtamaku
      by mtamaku
       
      Started by traderMNQ, Today, 09:00 AM
      4 responses
      21 views
      0 likes
      Last Post traderMNQ  
      Working...
      X