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

Contract Size Problem

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

    #16
    Let's simplify this. It really isn't that hard to understand. Put the NT SampleMACrossOver strategy on a chart and let it run for a bit and see if it enters with 1 or 2 contracts. If it enters with 2 contracts, look at the PNL and see if it reflects an entry with 2 contracts. The SampleMACrossOver strategy that came with my NT enters with 2 contracts every time and the PNL reflects 2 contracts.


    That all it amounts to.

    Mike

    Comment


      #17
      Hi Mike,

      Please post a screenshot of what you think is incorrect, otherwise hard to follow exactly for us.

      I think Josh explained it well in post #13, it will look like 2 contracts on a reversal, because even though position size is 1, the strategy needs to close 1 first and then enter another one to reverse the complete position.

      Hope that makes sense...have a good day!
      BertrandNinjaTrader Customer Service

      Comment


        #18
        In an effort to resolve this on my own, I uninstalled NT and deleted the NT6.5 folders in the My Documents folder as well as the one in the Programs folder. I also searched through the registry to make sure there wasn't anything left referring to NT. Then I installed NT version 6.5.1000.7 as if it were a brand new installation. This way I know there isn't anything hanging around out there causing problems.
        I loaded the SampleMACrossOver strategy on a chart and of course it displayed all the entries and exits based on historic data and those all look as they should or at least they look ok to me.
        Look at the file named ZG 02-09 12_4_2008(3 Range).jpg
        Everything before 7:03 is based on historic data so you don't see that on the chart. I stretched the chart out so you can see the entries that are in question. They look correct on the chart. 1 label indicates a contract to close the previous position and 1 contract for the new position. There are 3 completed trades shown there.
        1. buy @ 770.5 Closed at 768.8 PNL based on my calculation is -1.7
        2. Sell @ 768.8 closed @ 771.1 PNL based on my calculation is -2.3
        3. buy @ 771.1 closed @ 769.1 PNL based on my calculation is -2
        4. sell @ 769.1 and is still open according to this chart
        Those 3 trades reflect a total PNL of -6 points, 2 buys and 1 sell.
        Now look at the file named AccountPerformanceTrades.jpg. This shows the Trades tab. Notice there are 4 trades. All are longs and no shorts. Total PNL for the 4 trades it says were taken is -7.6 points for the 4 long positions that it says were taken as opposed to the 2 long and 1 short positions shown on the chart. What the AccountPerformanceTrades should show is 3 trades exactly like what the chart shows, 2 longs and 1 short.
        AccountPerformanceExecutions.jpg shows the actual executions. I leave that to you to interpret.
        I also provided a picture of the Orders tab, filename is Orders.jpg.
        It is very clear to me that the SampleMACrossOver strategy on my computer is NOT performing as a stop and reverse. It is only entering long positions and entering with 1 contract but is doing that twice for each execution for a total of 2 contracts.

        Just for grins,I'm going to try the same thing on my other computer and will let you know what happens.
        Attached Files

        Comment


          #19
          Hi Mike Winfrey,

          Thanks for your efforts in reproducing this.

          But I don't see the problem, looking at your first chart it shows 4 trades (last one still open), 2 long and 2 short, which the 2 other screenshots correcly reference in the Entry and Exit names.

          Looking at your last Orders screenshot you see 4 unique execution times, which is correct.
          BertrandNinjaTrader Customer Service

          Comment


            #20
            There should be 3 trades, 2 longs and 1 short. There are only 2 longs. What happened to the short. Further, on the 2 longs, why is the PNL twice what it should be?

            You need to look at the other attachments I sent and you will see that.
            Last edited by Mike Winfrey; 12-04-2008, 07:28 AM.

            Comment


              #21
              Hi Mike Winfrey,

              looking through your executions it looks correct, as you need to take into account the previous short trade you are in historically, for which you buy one contract to close the position and the other one to initiate the new long trade. After that you see 3 'fresh' trades if you will.

              If you still feel something is wrong, please forward me your logs and traces to support at ninjatrader dot com referencing this thread and we take it from there.

              Thanks!
              BertrandNinjaTrader Customer Service

              Comment


                #22
                Thanks for your help. I want to make one more point before I collect the additional information you ask for. Let me know if you still want the additional stuff after you evaluate my comment below.

                The short trade I'm referring to is the one sandwiched between the 2 longs. That short has no PNL associated with it. Look at the PNL and you will see there is only PNL for 4 longs when there should be PNL for 2 longs and 1 short.

                To illustrate this I ask you to look at the file I attached in my previous post that is named AccountPerformanceTrades.jpg. Trades 1 through 4 are longs with associated PNL for each of those 4 trades. As you can see on the chart there were only 2 completed long trades with a short in between.

                If this sample strategy is a stop and reverse strategy, why isn't there PNL for a short on the AccountPerformanceTrades.jpg? Is that my misunderstanding that this isn't a stop and reverse strategy?

                Comment


                  #23
                  Hi Mike,
                  No, you understand correctly, this is a reversal strategy.

                  Here is what I would suggest doing to get clarity -

                  Close your workspace and disconnect from your datafeed / broker.

                  Then go to Tools > Options > Misc and Repair your DB.

                  Next reconnect to your datafeed / broker and see if you see the same behavior you described previously.

                  If yes, please send me your logs and traces from inside NinjaTrader (Help > Mail to Support) and include this 11970 thread number.

                  Please also include reproducible steps for us to mimic your approach as close as we can.

                  Thanks for your efforts!
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by llanqui, Today, 10:32 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Started by StockTrader88, 03-06-2021, 08:58 AM
                  45 responses
                  3,992 views
                  3 likes
                  Last Post johntraderuser2  
                  Started by TAJTrades, Today, 09:46 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post TAJTrades  
                  Started by rhyminkevin, Yesterday, 04:58 PM
                  5 responses
                  62 views
                  0 likes
                  Last Post dp8282
                  by dp8282
                   
                  Started by realblubb, Today, 09:28 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post realblubb  
                  Working...
                  X