Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

different timeframes

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

    different timeframes

    When using different timeframes in a strategy eg

    if (Stochastics(BarsArray[7],3,5,2).K[0] > 80
    && Stochastics(BarsArray[1],3,5,2).K[0] > 50
    && Stochastics(BarsArray[3],3,5,2).K[0] > 80
    && Stochastics(BarsArray[5],3,5,2).K[0] > 80
    )
    {Variable1 = 1;}


    is there to add something to make it working correctly?


    Thanks
    Tony

    #2
    Hello Tony,

    You would need to check that the Bars are updating for these intervals using BarsInProgress:



    Please review our Help Guide for more information on multiple data series indicators and strategies:

    MatthewNinjaTrader Product Management

    Comment


      #3
      In your samplemultitimeframe there is only

      if (BarsInProgress != 0)
      return;


      Is this all to do for working with different timeframes? (Should be, as its your sample)






      Originally posted by NinjaTrader_Matthew View Post
      Hello Tony,

      You would need to check that the Bars are updating for these intervals using BarsInProgress:



      Please review our Help Guide for more information on multiple data series indicators and strategies:

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

      Comment


        #4
        Tony,

        Using a value of 0 in BIP would give refernece the primary data series. A value of 1 would give you the second data series.

        The BIP filter you use will depend on what you're trying to do in the context of the code.

        Can you please clarify if you're currently receiving any errors with the code you're using? If so what do these errors report?
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thank you for your reply.

          Referring to your question about the error-message the problem is that when I want to run the strategy in 50range but the entry with my 8th timeframe renko and I code it the way below - referring to the support information - I get only 0 in the strategy summary.

          if (BarsInProgress == 8
          && Position.MarketPosition == MarketPosition.Flat
          && Variable1 == 1
          && Closes[8][1] > Opens[8][1]
          && Closes[8][0] < Opens[8][0])
          {
          EnterShort(10000, "S1");
          }



          Therefore occur the 2nd question and I want to ask if its OK when I use in another strategy the different timeframes correctly when I run the strategy in a 50range chart and I have conditions with other timeframes as shown in the beginning of this thread.


          Best
          Tony


          Originally posted by NinjaTrader_Matthew View Post
          Tony,

          Using a value of 0 in BIP would give refernece the primary data series. A value of 1 would give you the second data series.

          The BIP filter you use will depend on what you're trying to do in the context of the code.

          Can you please clarify if you're currently receiving any errors with the code you're using? If so what do these errors report?

          Comment


            #6
            Hello Tony,

            For the issue of the results being 0, I would recommend running TraceOrders property to retrieve more information as to why the orders are not submitting when the conditions are true:



            If you have trouble interrupting the output from TraceOrders, please let me know these results and I'd be happy to take a look
            MatthewNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by xiinteractive, 04-09-2024, 08:08 AM
            5 responses
            13 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by swestendorf, Today, 11:14 AM
            2 responses
            5 views
            0 likes
            Last Post NinjaTrader_Kimberly  
            Started by Mupulen, Today, 11:26 AM
            0 responses
            2 views
            0 likes
            Last Post Mupulen
            by Mupulen
             
            Started by Sparkyboy, Today, 10:57 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by TheMarlin801, 10-13-2020, 01:40 AM
            21 responses
            3,918 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Working...
            X