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

Same Name

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

    Same Name

    In my strategy, I have declared private Order Trade1 = null and I have used the string Trade1 for the name in SetProfitTarget and as the name in Enter Long/Short. The reporting in Trade Performance Report is all screwed up. Have I created a conflict by using the same name in all three location?

    #2
    Hello galsermil,

    The private Order Trade1 variable name has nothing to do reporting, that is exclusively the name you gave the variable in the C# code. You could make that variable name anything and it won't affect the results you are seeing.

    The SignalName and FromEntrySignal name should be the same. For example, your entry name is Trade1, that means any target which is paired with this entry should have its FromEntrySignal name as Trade1.

    SetProfitTarget does not allow you to define a different name for the actual profit target like an exit order so you would use the entries name with SetProfitTarget.

    Other exit orders do have a SignalName which represents the exit order name and that should be different from the entry order name. For example: ExitLong(string signalName, string fromEntrySignal), this would be a unique name for SignalName to name the target and the entries name Trade1 as the FromEntrySignal.

    If you are seeing the reporting in the trade performance as incorrect you would need to find the first instance of where that happens to better understand what may be causing the discrepancy. Trade performance can be incorrect if not all of the information is present, one situation would be transitioning from historical to realtime. If you had an entry order which was filled historically and then closed in realtime you need to view the historical + realtime report so the trades are paired accurately. If you omit the historical information that will create invalid trade pairing because the first trade didn't have the historical information to make a valid trade. The term trade being used means a Entry + Exit.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse,

      You are going to get me on my soap box because it has always aggrevated me the way Ninja deals with historical data but I don't see how it is my responsibility to have to separate the two. I don't know and I don't care whether the order was filled historicaly or realtime but I expect the correct order to be matched with the exit especially since it is the only entry outstanding in that instrument. I bring this up because that seems to be what happens with these incorrrect reports as the wrong entry is tied to the exit. I cannot be sure that that is the only problem with the reporting but when my chart shows a 13 Pip profit and the report gives me negative profit that usually is what went wrong. The foregoing is the reason that I was questioning conflicts.

      Comment


        #4
        Hello galsermil,

        I'm sorry that makes you aggravated however that is how the platform operates. You will have to work with the bounds of how the platform operates.

        I had provided one example of a commonly brought up item which is a historical entry and realtime exit and then not viewing the report that includes both entry + exit. In that situation you are not including the needed data to pair a trade, the platform can't arbitrarily include the historical trades because the Realtime report doesn't include that data. If that's the specific situation you ran into you just need to select the right report which includes all trades the strategy made.

        Every strategy is unique so this is highly dependent on what you made. I understand you don't care if it was historical or realtime but the platform pairs trades in a specific way that requires to know that. If you don't know if your strategy is placing historical or realtime trades that would be the place to start researching the problem. You will absolutely need to be aware of the difference between historical trades and realtime trades to know what report to use or use the combination report. In most cases its best to just select historical + realtime to ensure all trade data is being included so the report can pair the data correctly. If you don't include a historical entry that would mean the first Exit in realtime becomes an Entry and skews the reporting.

        The Pnl would also be affected if you don't include the relevant executions to calculate the performance. Assuming the same situation as described if you exclude the entry execution and start with the exit then the PnL is not going to be accurate because part of the data needed to calculate the Pnl is just not present.




        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse,

          I want to continue this discussion as I can see the possibility of eliminating some of aggravation for me but first I need to know ,what report are you talking about? When day trading I only use the Trade Performance Report, and the two tabs of 'Orders' and 'Executions'. The last item of interest for now is the fact that my strategy contains the statement <if(State != State.Realtime), return();. Have I affected more than the history processed before the strategy was enabled. Without this statement the strategy creates entries which it treats as real down the line..

          Comment


            #6
            Hello galsermil,

            We are discussing the strategies performance. That is also called trade performance but isolated to a individual strategy. You can see an example of that here: https://ninjatrader.com/support/help...egyPerformance

            The control center new menu also has a Trade Performance option but that is not just for your one strategy, that's for everything you do. If you run multiple strategies or manually trade that is not going to be a good way to view the strategies performance.


            <if(State != State.Realtime), return();. Have I affected more than the history processed before the strategy was enabled. Without this statement the strategy creates entries which it treats as real down the line..
            If you are only placing trades in realtime you can just view the realtime report for the strategy. If the strategy places historical trades that will affect the overall logic and will place historical trades. Historical trade can close in historical or transition to realtime which would entail that you view the strategies performance report for historical + realtime for an accurate reading.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X