• 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

Store the close price for a reference.

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

    Store the close price for a reference.

    Hi,
    I would appreciate if someone can help me with this.

    Step1 I want to store the close price as a value only when the price crosses below lower BB.

    Step2 I want to use that value to scale in a position.
    ie: if Close[0] < value - (3* ATR(14)[0])
    EnterLong(1,"" Lg1");

    Step2 I want to use that value to scale in a position. if Close[0] < value - (6* ATR(14)[0])
    EnterLong(2,"" Lg2");

    The problem I have is storing the value under a specific conditions.

    Many Thx,
    RNR123

    #2
    rnr123, you would just need to check for your condition and then assign the close value to your variable as it returns true, for example -

    Code:
     
    if (Close[0] > Bollinger(2, 20).Upper[0] && Close[1] < Bollinger(2, 20).Upper[1]);
    myValue = Close[0];
    This will store the close price to the variable myValue only if it crossed above the upper Bollinger Band, then you can use this in further calculations.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks

      Thank you Bertrand

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by thecashguys, Today, 10:18 AM
      0 responses
      4 views
      0 likes
      Last Post thecashguys  
      Started by pjsmith, Today, 09:58 AM
      0 responses
      8 views
      0 likes
      Last Post pjsmith
      by pjsmith
       
      Started by bebbus, Today, 09:13 AM
      0 responses
      6 views
      0 likes
      Last Post bebbus
      by bebbus
       
      Started by roblogic, Today, 08:04 AM
      0 responses
      7 views
      0 likes
      Last Post roblogic  
      Started by williamzz, Yesterday, 04:18 PM
      2 responses
      10 views
      0 likes
      Last Post williamzz  
      Working...
      X