Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Order functions

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

    Order functions

    Is it possible that you could post the recommended code pattern for the following:

    As a specific event occurs (for example the closing price of a bar crosses a certain price point) I want to enter a position (say 10 long). The strategy is not to do anything until that position has been reached. How do I ensure that the target position is reached no matter what?

    Running a test on a 1 tick chart on FDAX 09-07 I had some weird things happen. If I only call EnterLong() on the initial bar I sometimes got my order cancelled partially filled. If I resubmit until the target position is reached I sometimes got errors or overfill depending on if I called the function again with the target quantity or the target quantity minus the current MarketPosition.Quantity.

    The problems seemed to happen at random, but were much less frequent on slower moving markets.

    I am sure I must be doing something wrong, but I am just not sure what. Therefore my question.

    #2
    Sorry, due to bandwidth reasons we are unable to provide support at that level. You might consider contacting a NinjaTrader consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rene69851, 05-02-2024, 03:25 PM
    1 response
    20 views
    0 likes
    Last Post rene69851  
    Started by ETFVoyageur, Yesterday, 07:05 PM
    5 responses
    43 views
    0 likes
    Last Post ETFVoyageur  
    Started by jpeep, 08-16-2020, 08:31 AM
    13 responses
    487 views
    0 likes
    Last Post notenufftime  
    Started by realblubb, 04-28-2024, 09:28 AM
    2 responses
    32 views
    0 likes
    Last Post realblubb  
    Started by bmarovets, Today, 06:33 PM
    0 responses
    12 views
    0 likes
    Last Post bmarovets  
    Working...
    X