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

Memory Leaks?

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

    #16
    Originally posted by r2kTrader View Post
    Is anyone experiencing inconsistent results when doing many back to back strategy analysis?
    Wanting to stay out of the rest of this ... but, I also wanted to share that you should keep an eye on your Control Center "log" tab for out of memory errors, they do not always get thrown in a dialog box and may go unnoticed.

    Many, many (many!) times this has happened to me where a strategy works fine the first xx number of times I backtest it, then starts giving weird results or no results, only to find there was a message in the log about out of memory (and I am talking about identical period dates).

    So, if you aren't already looking at the log tab constantly, I suggest adding it as a habit My control center stays on the log tab 100% of the time during development.

    Last, NT7 is supposed to make huge improvements in the area of memory management, leak fixes, more efficiency, etc etc

    Mike

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      r2kTrader,

      We fully appreciate and thank you for your efforts in trying to isolate issues you encounter. I do understand all you want is for someone to look at your script, but please understand that we cannot spend time going back and forth trying to reproduce scripts. All I am requesting is to simply attach your scripts if it is something you want us to look at.

      A. You already have the scripts.
      B. More importantly, there will be no ambiguity as to how you have made your scripts and how to reproduce.

      It is our experience when trying to reproduce customer scripts that more often than not a critical component is not revealed to the support team until after several back and forths of failing to be able to reproduce customer concerns. Because of this reason we request all customers to simply attach their simple-as-possible, complete scripts and then we will be able to evaluate them.

      This will be the last I say about this. Thank you for understanding the reasoning behind this policy.

      Now, back to the important matter. Please consider your strategy which goes long and short. You have in place a single profit target that says "target at price $200" for this instrument. This works fine for longs because let's say you enter the market at $100. That would be a +$100 profit target for it, but now consider the shorts. You enter a short position at $100 then you place a profit target at price = $200. For a short, profit targets actually need to be <$100, but since we placed one at $200 you get filled immediately at that price. Essentially all of your short trades are getting you filled at $200 for a loss of $100 per trade and that quickly aggregates you to the outrageous losses seen on your strategy results. Hopefully that makes sense.
      That makes absolutely NO SENSE AT ALL!

      You are saying that for the short trades I need to say -200.00 ?

      Also, it wouldn't explain 6,000,000 in losses on 150 trades.

      Profit is profit, are you saying I have to calculate negative profits when on the short side and have a negative value? Isn't 200.00 in profit 200.00 in profit?

      Do I need to setup two different profit targets, one for short trades, the other for long and do a marketposition test of somekind? Or link to the Trade Label in some way to make sure my short side is say -200.00 and long side is say 200.00?

      Comment


        #18
        No, r2kTrader. If you want to have a profit for $200 you need to be selecting CASH mode and not CalculationMode.Price.

        CalculationMode.Price means submit a profit target order at the exact price I specify. You specified $200 to be the price and that is where the order went regardless of long or short because you did not use signal names. If you want $200 in profit amount, select the Profit Target cash.

        As far as 6mil losses I don't see it on my end, but it surely could be the case depending on the trades. Just take a look at the trade journal and you can see it to be feasible. In either case, it does not matter because you are not submitting the order you were intending to do.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Josh View Post
          No, r2kTrader. If you want to have a profit for $200 you need to be selecting CASH mode and not CalculationMode.Price.

          CalculationMode.Price means submit a profit target order at the exact price I specify. You specified $200 to be the price and that is where the order went regardless of long or short because you did not use signal names. If you want $200 in profit amount, select the Profit Target cash.

          As far as 6mil losses I don't see it on my end, but it surely could be the case depending on the trades. Just take a look at the trade journal and you can see it to be feasible. In either case, it does not matter because you are not submitting the order you were intending to do.
          So I would use ticks then if using the wizard? There is no "cash" setting under the wizard.

          I don't care for the wizard, but I like to start with it for the basic template, then make sure it does as expected, add, then do as expected, then unlock.


          Thanks

          Comment


            #20
            There is cash in the Wizard. When you press the Add button you have two selections. "Profit Target" or "Profit Target (cash)". The first has the three modes. The second is just pure cash.

            For coding wise there is a SetProfitTarget(double currency) signature which is for cash.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Excellent, now that solves that. The only question now is how can I redeem myself ??

              Comment


                #22
                Glad we were able to get this resolved today. Have a good weekend.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by NinjaTrader_Josh View Post
                  Glad we were able to get this resolved today. Have a good weekend.
                  Josh,

                  You too.

                  I owe you a beer.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DawnTreader, 05-08-2024, 05:58 PM
                  11 responses
                  39 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by sofortune, Today, 10:28 AM
                  2 responses
                  5 views
                  0 likes
                  Last Post sofortune  
                  Started by tkaboris, Today, 06:27 AM
                  4 responses
                  13 views
                  0 likes
                  Last Post tkaboris  
                  Started by marcus2300, Today, 10:21 AM
                  2 responses
                  4 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by proptradingshop, Today, 10:07 AM
                  3 responses
                  5 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X