• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Paper trading Strategies

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

    Paper trading Strategies

    Hello,

    I just enabled several strategis on my paper account and I wanted to be sure I'm doing this right. I have added a code to "return" if "historical" so to avoid the portfolio sync issue. However something doesn't feel right (I might be wrong...). I'm afraid that the strategy will never trigger because it includes two different days: something has to happen yesterday to trigger a signal today. How do I ensure that the strategy is working properly?

    Hope I mead myself clear!

    Thanks.
    Tex

    #2
    Hello,

    Not sure I understand the question exactly.

    Are you aware what if(!Historical) return exactly does? It stops processing on historical data to get to the current state.

    Your code would only run live, you wouldn't be able to run historically with that statement so you have to pick one or the other.

    You may need to look at another one of the strategy sync options.


    Strategy Position vs. Account Position:
    http://www.ninjatrader-support2.com/...ead.php?t=4033

    1st solution:

    You can include the following statement in your code to avoid the strategy to be calculated on historical data.

    // Only run on real-time data
    if (Historical)
    return;
    Add the statement to the top of OnBarUpdate()

    2nd solution:
    You can set 'On starting a real-time strategy' to 'Wait until flat before executing live'.
    This option can be found at Tools-->Options-->Strategies-->NinjaScript-tab.

    3rd solution, would be submitting manual orders to sync the strategy and account positions described in the link

    4th solution, would be to enable Sync account position to true.

    http://www.ninjatrader.com/support/h..._positions.htm
    BrettNinjaTrader Product Management

    Comment


      #3
      Thanks for the info. I have enable the option "Wait until flat..." to TRUE. I have also changed the "Sync with account" to FALSE. If I understand correctly when I enable a strategy NT should just wait for a condition based on historical data indicated by the strategy options "Min bars" and "Max bars...". I still got a few "Your position in not in sync...". What am I missing?

      Comment


        #4
        Correct with WaitUntilFlat used, it would monitor for the fresh entry signal generated live only and execute it then, it would not attempt managing a virtual position coming from historical data. Which provider / broker and instrument are you testing with?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          TD Ameritrade...

          Comment


            #6
            Thanks, so the TDA account you execute to is not in a flat state as you start the strategy?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              I'm sorry (still learning!). The connection is TD Ameritrade but the account is Sim101 and it was flat. BTW do we refer to "flat" for the entire account or for that spefici instrument?

              Comment


                #8
                No worries, it could be meant for multiple things, an account is flat, an account is flat for a given instrument or a strategy position would be flat. Here for the TDA live account it would be in context for the executed to symbol / instrument, with WaitUntilFlat set the account should be in a flat state as well when the strategy is started. For the Sim101 internal account those considerations though would not apply.

                It would help if we could review your diagnostic trace / log files for this case, would you mind contacting us via Help >> Mail to Support from within your NT Control Center? Then those files would be automatically forwarded to us.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Done! Sent log via NT support. Please let me know.

                  Thanks.
                  Tex

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Ousher, Yesterday, 11:56 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Ousher
                  by Ousher
                   
                  Started by djt1102, Yesterday, 07:55 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Marco  
                  Started by jleira, Yesterday, 10:26 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post jleira
                  by jleira
                   
                  Started by wuileng, Yesterday, 10:14 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post wuileng
                  by wuileng
                   
                  Started by mntemel, Yesterday, 09:07 PM
                  1 response
                  10 views
                  0 likes
                  Last Post MojoJojo  
                  Working...
                  X