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 pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    149 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,283 views
    0 likes
    Last Post Leafcutter  
    Working...
    X