Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unrealized without position

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

    Unrealized without position

    Why when I start strategy I have unrealized profit or loss but I have no position? And strategy don't work until exit order will executed. But again I don't see this exit order anywhere I only see that unrealised profit or loss stayed realised. After this strategy work normal.
    How I can set my strategy that it will work from beginning after start?

    #2
    Please try adding:
    Code:
    if (Historical)
     return:
    ... to your OnBarUpdate method.

    Comment


      #3
      In which place I must add code.


      protected override void OnBarUpdate()

      {
      Last edited by add000; 04-18-2008, 10:23 AM.

      Comment


        #4
        protected override void OnBarUpdate()
        {
        if (Historical)
        return;
        .....

        Comment


          #5
          The same work after adding code.
          Don't work normal.

          Comment


            #6
            I am jumping in late but maybe there is some confusion about what is expected.

            Can you review this thread and see if this might clear things up?

            RayNinjaTrader Customer Service

            Comment


              #7
              OK I understand now how it must work.
              But it not work how Josh wrote.
              For example:
              I can't close strategy position by account position. And if I open same position in account position manually strategy don't close this position, it close self position but not my (account position).

              What can I do that strategy work normal?

              Comment


                #8
                Not sure I follow.

                - If you start a strategy and it is long 1
                - If your account is flat you can manually add 1 long to your account in Control Center Orders tab
                - If your strategy now sells 1 so that it is flat --> Your account will not be flat
                RayNinjaTrader Customer Service

                Comment


                  #9
                  Yes.

                  - I manually add 1 long.
                  - Strategy sells 1 so that it is flat
                  - But I have 1 long in my account positions.

                  Comment


                    #10
                    Could be several things -

                    - Strategy is not running on the same account that you opened a position on
                    - Check Tools > Options > Strategies > NinjaScript, ensure that "Immediately submit..." is checked and NOT "Wait until flat..."
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      Yes, it was "Wait until flat...".

                      But

                      I need that after start my strategy will work without "...determine the current position state it would be in if it had been running live since the start of the session".
                      When I start strategy I start my session and I don't need open position. I think so.

                      In any case Thanks very much for your help

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by junkone, Today, 11:37 AM
                      2 responses
                      14 views
                      0 likes
                      Last Post junkone
                      by junkone
                       
                      Started by frankthearm, Yesterday, 09:08 AM
                      12 responses
                      44 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Started by quantismo, 04-17-2024, 05:13 PM
                      5 responses
                      35 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by proptrade13, Today, 11:06 AM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Started by love2code2trade, 04-17-2024, 01:45 PM
                      4 responses
                      35 views
                      0 likes
                      Last Post love2code2trade  
                      Working...
                      X