Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Stops and Targets

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

    Strategy Stops and Targets

    What is the correct procedure for keeping Strategies Executions separated?

    I have 3 Strategies running on 3 different charts. The Exits are coming from the a script that did not make the Entry. I have included an image to help explain.

    Are the any settings that need to be made?
    Attached Files

    #2
    Hi TAJTrades,

    Unfortunately you cannot keep them separate at the reporting level.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      They are not even separated on the charts which has me very confused. That is the reason I am questioning if I have over looked something.

      Any suggestions?

      Thanks for the great support help!
      Attached Files

      Comment


        #4
        TAJTrades,

        How are you determining that it has closed? By the stop-loss triangle you have that is raised and should have been subsequently filled?

        What do your TraceOrders = true say?
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          TAJTrades,

          I just discussed this with development and the issue is when reporting. In real-time there is absolutely no problem running the strategy as it will be able to keep everything in order. Everything is managed per strategy position. When you try to look at it again in a reporting fashion NT just accesses the database and ends up show you all the orders together as an account position. This is why you see the interconnection when reporting.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Josh,

            I will review the code again tonight. I will also throw the Trace Logs back on the Strategy. I removed them for performance reason. Will follow up tomorrow to let you know what happened.

            Comment


              #7
              Situation: 3 different Strategies running on 3 different 500 vol Charts. All Signal Names are different. Problem arises when each Strategy has an open position so there could be 2 Long Trades and 1 Short open at any time. When this happens the Stops and Targets are not remaining attached to each open position.

              I think I found the Error. I have modified your Strategy Sample to enable Good Till Canceled Orders. The "FiveEntry" Strategy is on a 500 Vol Chart calling the 5 Min Chart for some indicator values. Therefore BarsInProgress = 0.

              The Entry Code:
              if( Position.MarketPosition == MarketPosition.Flat && BuySignal==true)
              {
              entryOrder = EnterLongLimit(0, true, 1, Close[1] , "FiveEntry");
              barNumberOfOrder = CurrentBar;
              }

              Per the Help File the syntax for Advanced Order Handling is:
              EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)



              And the TraceOrders results:
              Is there suppose to be a name for "FromEntrySignal" at the end of the first line? If so, how do I modify the entryOrder code above?

              11/11/2008 4:10:31 PM Entered internal PlaceOrder() method at 11/11/2008 4:10:31 PM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=895.50 StopPrice=0 SignalName='FiveEntry' FromEntrySignal=''

              11/11/2008 4:10:35 PM Entered internal PlaceOrder() method at 11/11/2008 4:10:35 PM: Action=BuyToCover OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=897.50 SignalName='FiveStop' FromEntrySignal='FiveEntry'

              11/11/2008 4:10:35 PM Entered internal PlaceOrder() method at 11/11/2008 4:10:35 PM: Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=893.50 StopPrice=0 SignalName='FiveTarget' FromEntrySignal='FiveEntry'

              11/11/2008 4:11:57 PM Cancelled remaining exit order: Order='a839dec8c0424be5af598208d1ed3759/Sim101' Name='FiveTarget' State=Filled Instrument='ES 12-08' Action=BuyToCover Limit price=893.5 Stop price=0 Quantity=1 Strategy='FiveMinuteMidline' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=893.5 Token='a839dec8c0424be5af598208d1ed3759' Gtd='12/1/2099 12:00:00 AM'

              11/11/2008 4:11:57 PM Cancelled remaining exit order: Order='ce57b788bdca42a79fc6880aa6cd6740/Sim101' Name='FiveStop' State=Accepted Instrument='ES 12-08' Action=BuyToCover Limit price=0 Stop price=897.5 Quantity=1 Strategy='FiveMinuteMidline' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='ce57b788bdca42a79fc6880aa6cd6740' Gtd='12/1/2099 12:00:00 AM'


              Thanks again,

              Comment


                #8
                TAJTrades,

                The individual strategies will keep track of each of their strategy positions individually. When viewing a report of them they will appear intertwined though because it is displaying it as an overall account position. Your traces look fine to me. The first one will not have a FromEntrySignal because that is the entry signal.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh,

                  I am trying to come up with a way to Forward Test Strategies. My idea was to let the Strategies run in the background for a week/month and then from the Account Performance/Trades tab export the trades report to Excel for evaluation of each individual strategy. So at the end of a week/month I can trash the weak performer and replace it with another strategy. And that cycle continues. So working within the NT environment what is the best way to accomplish this? Accurately!

                  I am also working on an Order Management Template so I am not spending time reinventing the wheel. All I want to do is change the code that generates the signals. Maybe I have some serious flawed logic in the template. It is a work in progress but I have included it here. Maybe you can spot the flaws.

                  Also if there are any coders that have an interest in working with me on this template let me know.

                  THIS IS NOT A COMPLETE WORK! So don't use it to trade.
                  Attached Files

                  Comment


                    #10
                    Hi TAJTrades,

                    Unfortunately I cannot evaluate your template due to bandwidth reasons. For forward testing what you could try is creating yourself 3 sim accounts then placing each strategy to make trades on a different account. This way when you report you can separate them out by the different accounts.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Josh View Post
                      Hi TAJTrades,

                      Unfortunately I cannot evaluate your template due to bandwidth reasons. For forward testing what you could try is creating yourself 3 sim accounts then placing each strategy to make trades on a different account. This way when you report you can separate them out by the different accounts.
                      How do I create additional Sim Accounts? Can you point me in the right direction.

                      Thanks

                      Comment


                        #12
                        Tools->Options->Simulator->Accounts->Type in a new name->Save
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by vecnopus, Today, 06:15 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post vecnopus  
                        Started by Aviram Y, Today, 05:29 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post Aviram Y  
                        Started by quantismo, 04-17-2024, 05:13 PM
                        3 responses
                        27 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by ScottWalsh, 04-16-2024, 04:29 PM
                        7 responses
                        36 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by cls71, Today, 04:45 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post cls71
                        by cls71
                         
                        Working...
                        X