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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          65 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X