Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Position with ExitLong/ExitShort

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

    New Position with ExitLong/ExitShort

    Hello,

    it occurs that with ExitLong and ExitShort that there are new entries triggered eg in fast moving markets. Doesnt "Exit" refer to an existing position and always "take off positions instead of adding" , so that it should not execute an entry?

    When this can occur it seems that eg instead anexitlong there could also be an entershort in a script?

    Isn´t there a possibiltiy to close all trades of a certain instrument? How would the function of the close-button in chart-trader be to add in a script-strategy (I work with customized buttons in the toolbar, so this is not the problem, what I dont know is the exact code to have same result as with "Close") - because flatten everything is for all instruments!

    Thank you
    Tony

    #2
    Hello tonynt,

    Here are the definitions from the helpguide on ExitShort() and ExitLong():
    ExitLong(): Generates a sell market order to exit a long position.
    ExitShort(): Generates a buy to cover market order to exit a short position.

    Bottomline, if you are in a position you have to close that position with an opposite side order and it is as simple as that, the rest is just terminology to make it easier and more understandable when coding.

    For both ExitLong() and ExitShort() note that: If you do not specify a quantity the entire position is exited rendering your strategy flat.

    So for your button code you could have it check if you are either long or short and then execute either ExitLong() or ExitShort().
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. Of course one has to check if long or short, usually.
      I have seperate scripts for longs and shorts.

      I try to explain different: I close a position with cqg trader which I use for monitoring my NinjaTrader positions and orders. Why do I close with cqg trader? Because NT was frozen that time but my limit was filled that moment. When NT was working again correctly after this high-volume-cpu-intensive time I tried to exit everything with my customized cancel button (this works all for years, this is not the issue) and in the script the cancel button does "exitlong and cancel-working-orders" But suddenly there was a new short position. So it seems that exitlong causes a new short position when there was no long position at that time when the "signal exitlong" was sent (no matter if by a condition or a button). It does not only exit, it also does enter. Yes?

      What is the corresponding order or code to the close button of chart trader please. It seems with this there is a.) no entry in opposite direction under certain circumstances and b.) the positions of other instruments are not closed.


      Thank you
      Tony

      Comment


        #4
        Hello tonynt,

        NinjaTrader should have seen the update on the order and position before submitting the close.

        May we review the Log and Trace for this instance?
        If so, please send the Log and Trace files for the date this occurred to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick - 1432537' in the subject line.

        You will find the log file on your PC in the (My) Documents > NinjaTrader 7 > Log folder.
        • The log file will be named "log.YYYYMMDD.txt"

        You will find the trace file on your PC in the (My) Documents > NinjaTrader 7 > Trace folder.
        • The trace file will be named "trace.YYYYMMDD.txt"

        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
        41 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        12 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