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 algospoke, Yesterday, 06:40 PM
              2 responses
              19 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              45 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              20 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              181 views
              0 likes
              Last Post jeronymite  
              Working...
              X