Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dataseries-first tick of bar

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

    dataseries-first tick of bar

    Hello,

    when I do eg in my NT-script for having a reversal bar in first dataseries

    Closes[1][1] > Opens[1][1] && Closes[1][0] < Opens[1][0])

    and I have COBC=false (because scipt-basic-dataseries eg Range 21 is higher than the added [1] eg Range5)
    and in the conditions && FirstTickOfBar then it seems that the FirstTickOfBar refers to the basic dataseries.

    What do I have to change please for doing the entry at Closes[1][1] > Opens[1][1] && Closes[1][0] < Opens[1][0]) and not only at close of higehr coding-dataseries?

    FirstTickOfBar [BarsArray[5],1]? or FirstTickofBars[1] ......

    (Or could I maybe do somehow COBC[0]=false; COBC[1]=true??)

    Thanks
    Tony
    Last edited by tonynt; 06-08-2012, 09:28 AM. Reason: clearify

    #2
    Hello tonynt,
    Please further filter your code with the BarsInProgress property to separate the logic between the 2 bars array.

    For example
    if (BarsInProgress == 1 && Closes[1][1] > Opens[1][1] && Closes[1][0] < Opens[1][0])
    {
    //do stuff
    }

    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you.

      And COBC=false: or COBC=true;??

      Thanks
      Tony

      Originally posted by NinjaTrader_Joydeep View Post
      Hello tonynt,
      Please further filter your code with the BarsInProgress property to separate the logic between the 2 bars array.

      For example
      if (BarsInProgress == 1 && Closes[1][1] > Opens[1][1] && Closes[1][0] < Opens[1][0])
      {
      //do stuff
      }

      http://www.ninjatrader.com/support/h...inprogress.htm

      Comment


        #4
        Hello tonynt,
        CalculateOnBarClose is not relevant here. You can set COBC to true or false depending on what your strategy demands.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hello,

          thank you for your reply. Sorry, but there is still a problem, can´t find out why its not working. I have in

          Initialize ... Add(PeriodType.Range,5);

          OnBarUpdate.....if (BarsInProgress !=0)
          return;

          if (BarsInProgress == 1 && Closes[1][1] > Opens[1][1] && Closes[1][0] < Opens[1][0]
          && Position.MarketPosition == MarketPosition.Flat)

          {
          EnterShort(2000, "K1a");.................
          }

          I run this script in a 21Range-Chart for having a good timeframe for marketstructue and to have the entry on a 5 Range chart.

          But there is no entry.

          For your information: I´m running different strategies with different timeframes without problems, but usually I have conditions like rising (HMA(BarsArray[3],34)............. in other timeframes without problems. I think the issue here is with the definition of the reversal bar maybe.

          Thanks
          Tony
          Last edited by tonynt; 06-11-2012, 01:22 PM. Reason: typing error

          Comment


            #6
            Hello tonynt,
            Please remove the below code and see if you can get the entries.
            Code:
            if (BarsInProgress !=0)
            return;

            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Joydeep

              thank you! Now it works.

              Have a great day!

              Best regards
              Tony

              Originally posted by NinjaTrader_Joydeep View Post
              Hello tonynt,
              Please remove the below code and see if you can get the entries.
              Code:
              if (BarsInProgress !=0)
              return;
              Please let me know if I can assist you any further.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              62 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X