Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check MarketPostion for a selected Timeframe

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

    Check MarketPostion for a selected Timeframe

    Hi,

    I am developing a Multi Timeframe/Instrument Strategy.
    "Positions[Index].MarketPosition == MarketPosition.Long" is telling me if I am in the market for any timeframe. How can I tell if I am in the market for a selected timeframe or index?

    Thank you
    / Manuel

    #2
    Hello Manuel,

    The Positions[index] is how you check the other time frames.

    So if you want BarsArray 0 use Positions[0].MarketPosition.

    If you want BarsArray 1 use Positions[1].MarketPosition.

    If you want the currently processing BarsInProgress position use Position.MarketPosition.

    http://www.ninjatrader.com/support/h.../positions.htm
    Last edited by NinjaTrader_ChelseaB; 08-12-2014, 09:42 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      confused

      I did test this already, but "Positions[Index].MarketPosition == MarketPosition.Long" was true for every timeframe in the same market when a trade was active.

      Its also documented like this if I do understand right:
      Primary Bars is ES 1 Minute
      Secondary Bars is ES 3 Minute
      Third Bars is ER2 1 Minute

      Positions[0] == ES position
      Positions[1] == Always a flat position, ES position will always be Positions[0]
      Positions[2] == ER2 position

      Comment


        #4
        Hi grasgruen,

        When adding the same symbol multiple times, only the first instance of that symbol will be able to have a position.

        The Position[1] will only always be flat if the second added data series is the same symbol as the first.

        Is every time frame using the same symbol?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes - same symbol (currency; eg. EURCHF), multiple timeframes.
          e.g. I need to check if I have an active position in timeframe 10min while being flat in timeframe 22min.

          Thanks

          Comment


            #6
            Hi grasgruen,

            If this is the same symbol, you can only have one position per symbol so the positions will be the same.

            You cannot be flat and long on the same symbol.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              But what is the EntriesPerDirection then for?
              I see in the trades-list, that I am 3 times in the same currency market at the same time with different timeframes.

              11 $CHFNOK KEL03MIN KEL03MIN Short 80000 6,8834 6,87 24.01.2014 13:34 24.01.2014 13:44 $CHFNOK Buy to cover 2 0,002017 0,015563

              12 $CHFNOK KEL03MIN KEL03MIN Short 80000 6,8834 6,87 24.01.2014 13:40 24.01.2014 13:44 $CHFNOK Buy to cover 2 0,002017 0,017611

              14 $CHFNOK KEL03MIN KEL03MIN Short 80000 6,8852 6,87 24.01.2014 13:44 24.01.2014 13:44 $CHFNOK Buy to cover 2 0,002278 0,022075

              Comment


                #8
                Hello grasgruen,

                Entries Per Direction controls the amount of orders than can be placed toward the same position.

                Lets say in my code I call EnterLong() on every new bar and do not call any exits. There is only one data series (the primary). Also the Entry Handling is AllEntries.

                If the quantity is 1 and Entries Per Direction is 1 then I can be long 1 and no further. All subsequent calls to EnterLong() will be ignored.

                If Entries Per Direction is changed to 2, then EnterLong() will be called twice and no further making the position long 2.

                If the quantity is also changed to 2, then 2 EnterLong()s will be called twice with 2 contracts each making the position long 4.

                Below is a link to Entries Per Direction.
                http://www.ninjatrader.com/support/h...rdirection.htm
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Shansen, 08-30-2019, 10:18 PM
                24 responses
                938 views
                0 likes
                Last Post spwizard  
                Started by Max238, Today, 01:28 AM
                0 responses
                3 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by rocketman7, Today, 01:00 AM
                0 responses
                2 views
                0 likes
                Last Post rocketman7  
                Started by wzgy0920, 04-20-2024, 06:09 PM
                2 responses
                27 views
                0 likes
                Last Post wzgy0920  
                Started by wzgy0920, 02-22-2024, 01:11 AM
                5 responses
                32 views
                0 likes
                Last Post wzgy0920  
                Working...
                X