Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to filter out pre and after market data

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

    How to filter out pre and after market data

    I have a system built in TD ameritrade's strategydesk, the system is based on data without including any pre or after market data (all indicators are calculated without pre or after market data). Is it a way to exclude those data in NinjaTrader in a convenient way? Thanks.

    #2
    skylimit, you could doubleclick on the chart to setup the needed session begin and end times in its properties - http://www.ninjatrader-support.com/H...roperties.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply, Bertrand.
      I have another question. I coded one strategy in 2 forms. One is initiating position using EnterShort(DefaultQuantity, "") or EnterLong(DefaultQuantity, ""), the other is using Limit order type : EnterLongLimit(DefaultQuantity, GetCurrentAsk(), "") or EnterShortLimit(DefaultQuantity, GetCurrentBid(), "").

      Then I ran both real time, I found that when both strategies take a position, the first one using market order would have a position shown in strategy tab of the main control center (1S or 1L), while the limit order strategy doesn't show a position. Both limit order and market order were submitted and filled when I did the test.

      Comment


        #4
        Hello skylimit,

        Could it be the 'limit - strategy' is not in a strategy position anymore after that limit order was filled? When you applied the 'limit - strategy' you were immediately in a position?

        Please see the link below for more information regarding account position vs. strategy position.
        JasonNinjaTrader Customer Service

        Comment


          #5
          Jason
          The "market strategy" and "limit strategy" are of the same logic except the order handling. When I was testing them, I ran them simultaneously. When there was a buy signal, both strategies sent order to IB and both got filled. Then I only saw the "market strategy" with the position shown as 1L in strategy tab of the control center. The "limit strategy", however, still shows no "1L" shown in the same place.
          I am still catching up for Ninjatrader programming, thanks for your help.


          Originally posted by NinjaTrader_Jason View Post
          Hello skylimit,

          Could it be the 'limit - strategy' is not in a strategy position anymore after that limit order was filled? When you applied the 'limit - strategy' you were immediately in a position?

          Please see the link below for more information regarding account position vs. strategy position.
          http://www.ninjatrader-support2.com/...ount+brokerage

          Comment


            #6
            Were the strategies applied on the exact same historical data?

            If the data was different, one strategy could have been in a strategy position, while the other is not.

            When the limit order was submitted and filled, the strategy that was initially in a strategy position, will show flat under the Strategies-tab.
            JasonNinjaTrader Customer Service

            Comment


              #7
              Jason, I applied two strategies in the same chart, so the data should be the same.
              I don't understand your second part of the explanation.

              when I started both strategies, both started with flat position. When both strategies got buy signal and sent orders to the brokerage account, both orders were filled in the account, but the limit order strategy doesn't have "1L" shown in strategy tab of the control center.


              Originally posted by NinjaTrader_Jason View Post
              Were the strategies applied on the exact same historical data?

              If the data was different, one strategy could have been in a strategy position, while the other is not.

              When the limit order was submitted and filled, the strategy that was initially in a strategy position, will show flat under the Strategies-tab.

              Comment


                #8
                Hi skylimit, the question Jason raised is - what strategy position where both strategies having before you saw the Market / Limit buys triggering...because you use different orders the strategy historical positions could be different as well even though the chart historical data would be the same.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  At the time of testing, both strategies give the same signal buy market and buy market respectively. I have tried several times, this issue remains consistent. the "Limit strategy" will fire a limit buy order when there is a buy signal. The order got filled, but the strategy tab doesn't show "1L" as expected. Since the logic has a condition to check strategy positions, if there is no 1L shown in strategy tab, I assume it would cause issues for my exit logic.


                  Originally posted by NinjaTrader_Bertrand View Post
                  Hi skylimit, the question Jason raised is - what strategy position where both strategies having before you saw the Market / Limit buys triggering...because you use different orders the strategy historical positions could be different as well even though the chart historical data would be the same.
                  Last edited by skylimit; 11-30-2009, 10:27 AM.

                  Comment


                    #10
                    Ok, please try putting

                    Code:
                     
                    if (Historical) return;
                    at the start of your OnBarupdate() for both strategies, then retry.

                    This will ensure both are flat as they place the orders - please also check the limit order one is indeed and filled and thus should report as position for the strategy.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by PhillT, Today, 02:16 PM
                    2 responses
                    3 views
                    0 likes
                    Last Post PhillT
                    by PhillT
                     
                    Started by Kaledus, Today, 01:29 PM
                    3 responses
                    9 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by frankthearm, Yesterday, 09:08 AM
                    14 responses
                    47 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by gentlebenthebear, Today, 01:30 AM
                    2 responses
                    13 views
                    0 likes
                    Last Post gentlebenthebear  
                    Started by PaulMohn, Today, 12:36 PM
                    2 responses
                    17 views
                    0 likes
                    Last Post PaulMohn  
                    Working...
                    X