Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Extreme ^TICK

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

    Extreme ^TICK

    HI

    I'm getting stopout on extreme ^TICK, (IB NYSE:$TICK-NYSE).
    Trading "ER2 Range Bars". Could you show me the Code:
    1. Not to take a trade when ^tick is over 1000
    2. Not to take a trade when ^tick is below -600


    Add("^TICK", PeriodType.Minute, 1); //(Range ?)

    && BarsArray[1] <= 600 ( CS0019 ) Error

    Thanks,

    #2
    In Initialiaze()"

    Code:
    Add("^Tick", PeriodType.Minute, 1);
    In OnBarUpdate()

    Code:
    // Processes the primary series you are trading on
    if (BarsInProgress == 0)
    {
        if (Closes[1][0] < 1000 && Closes[1][0] > -600)
            // Enter your trade here
    }
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray

      copy and paste, but no trades?

      protectedoverridevoid Initialize()
      {
      SetProfitTarget("", CalculationMode.Ticks, 8);
      SetStopLoss("", CalculationMode.Ticks, 10, false);
      Add("^Tick", PeriodType.Minute, 1);
      CalculateOnBarClose = true;
      }
      ///<summary>
      /// Called on each bar update event (incoming tick)
      ///</summary>
      protectedoverridevoid OnBarUpdate()
      {
      // Processes the primary series you are trading on
      if (BarsInProgress == 0)
      // Condition set 1
      if (CrossAbove(CCI(6), CCI(14), 1)
      && Closes[1][0] < 1000 && Closes[1][0] > -600// Tick Extreme
      && CCI(14)[0] > 0
      && CCI(14)[4] > 100)
      {
      EnterLong(DefaultQuantity, "");
      }

      Comment


        #4
        You will have to do a bit of detective work and debug your code. Following is a help article on debugging.

        RayNinjaTrader Customer Service

        Comment


          #5
          gary9 you will need { } brackets for your BarsInProgress if statement.

          protectedoverridevoid Initialize()
          {
          SetProfitTarget("", CalculationMode.Ticks, 8);
          SetStopLoss("", CalculationMode.Ticks, 10, false);
          Add("^Tick", PeriodType.Minute, 1);
          CalculateOnBarClose = true;
          }
          ///<summary>
          /// Called on each bar update event (incoming tick)
          ///</summary>
          protectedoverridevoid OnBarUpdate()
          {
          // Processes the primary series you are trading on
          if (BarsInProgress == 0)
          {
          // Condition set 1
          if (CrossAbove(CCI(6), CCI(14), 1)
          && Closes[1][0] < 1000 && Closes[1][0] > -600// Tick Extreme
          && CCI(14)[0] > 0
          && CCI(14)[4] > 100)
          {
          EnterLong(DefaultQuantity, "");
          }
          }
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          582 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          338 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X