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 burtoninlondon, Today, 12:38 AM
    0 responses
    4 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X