Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy executes too many contracts

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

    Strategy executes too many contracts

    Any strategy I run real time executes more contracts then I want. I only want the automated trading strategy to buy 1 contract and under specific conditions I want the strategy to exit my 1 long contract and then get me short 1 contract.

    Instead the strategy will get me out of the 1 long contract and get me short 2 contracts.

    Can you tell me which value I have set incorrectly when creating my strategy? I feel there is a setting that is not correct and is causing the strategy to purchase more contracts each time it executes.

    If I turn the strategy off and on between each trade then it will only execute the strategy on 1 contract but surely the system is designed so I do not have to do this all the time.
    Attached Files

    #2
    Hello JAL1721,
    The parameters are correct. It may be the case that the strategy is coded to submit double amount while reversing (martingale strategy).

    Please check that your code is not designed to do so.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      The strategy is a very simple strategy and I did not intend to utilize the martingale strategy. I have posted the actual script so you can let me know what part of the script is causing the multiple contract issue. I utilized the script wizard so there is no custom scripting here. This is a very simple script but I am not sure why the script will increase the contracts by 1 for each trade. So the first trade there is 1 contract and then when the lines cross and the trade flips sides the strategy gets me into 2 contracts and the next trade gets me into 3 contracts. The pattern is 1,2,3,4,5,6,etc...
      Attached Files

      Comment


        #4
        Hello JAL1721,
        EnterShort will close any long position and then will enter a short position. Reverse for EnterLong function.

        In your code the Exit() codes are redundant. Please remove the ExitLong and ExitShort codes and please see if you can get the correct order quantity.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hello,

          I have the same problem with increasing contracts in my reverse strategy (NT7 and NT8), but I don't use in code ExitLong and ExitShort (only EnterLong and EnterShort)
          Last edited by thinarthrill; 01-26-2017, 02:48 AM.

          Comment


            #6
            Hello thinarthrill,

            Thank you for your post and welcome to the NinjaTrader Support Forum!

            Please send me your log and trace files so that I may look into what occurred.

            You can do this by going to the Control Center-> Help-> Mail to Platform Support.

            Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

            Please list 'ATTN: Patrick H' in the subject line and reference this thread in the email.

            I look forward to assisting you further.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DanielTynera, Today, 01:14 AM
            0 responses
            2 views
            0 likes
            Last Post DanielTynera  
            Started by yertle, 04-18-2024, 08:38 AM
            9 responses
            40 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by techgetgame, Yesterday, 11:42 PM
            0 responses
            11 views
            0 likes
            Last Post techgetgame  
            Started by sephichapdson, Yesterday, 11:36 PM
            0 responses
            2 views
            0 likes
            Last Post sephichapdson  
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,615 views
            0 likes
            Last Post aligator  
            Working...
            X