Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLong(), EnterShort()

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

    EnterLong(), EnterShort()

    Looking at the simple MaCrossover study in action and comparing to its code it appears to me that EnterLong() function will reverse your position if you are already short.

    I have been looking in the documentation for where it says that is indeed what the default behavior is but I cannot find it.

    During this search I discovered that apparently, by default, an order is cancelled at the end of each bar? Can someone please point me to the documentation that discusses this behavior?

    #2
    bob100, I am not sure where the documentation is, but that is indeed the default behavior. If you are short one contract and call EnterLong(), it will reverse your position and put you long one contract (if you don't set quantity and such).

    The help guide page for EnterLongLimit() briefly discusses the default one bar lifespan of certain orders. There is also a bit of information on the Advanced Order Handling page. Lastly, when trying to find info about the EnterLong() behavior, I also stumbled upon the Managed Page, which describes the liveUntilCanceled idea in very specific terms:

    "Orders are primarily submitted from within the OnBarUpdate() method when a specific order method is called. By default, orders are kept alive provided that they are re-submitted on each call of the OnBarUpdate() method. If the order is not re-submitted, the order is then cancelled. If the order is re-submitted with changed parameters (new limit price for example) the order is modified."

    In the Entry Methods section of the Managed page, it says how the Enter methods can and do reverse positions.
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    22 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    21 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Working...
    X