• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders not launched

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

    Orders not launched

    Hi,

    I am working on undertanding how new orders are launched.
    For that, I have a very simple program:

    protected override void OnBarUpdate()
    {
    if (Position.MarketPosition == MarketPosition.Flat)
    if (CrossAbove(SMA(FastLenght), SMA(SlowLenght), 1)){
    entryOrder = EnterLongStop(1, Close[0] + 0.0003);
    ExitLongLimit(Low[0]);
    }
    }

    From this code I understand a new trade should be launched once the price goes above Close + 0.0003. However, I am taking a look at the chart and I can find many situations where the conditions fulfill the requirements but no traders are launched (an example can be found on the picture).

    May you help me understanding why?
    Attached Files

    #2
    Hello jemoce,

    Thank you for your note.

    Using EnterLongStop will submit an order which will be canceled if its not filled on the bar its submitted to.

    If you use the following EnterLongStop syntex, setting liveUntilCancelled to true, do you see entries where you expect them?

    Code:
    EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)
    https://ninjatrader.com/support/help...erlongstop.htm

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Longhornmark, Today, 08:25 AM
    3 responses
    11 views
    0 likes
    Last Post bltdavid  
    Started by mohdhm, Today, 04:09 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by BGWTEX, Today, 03:30 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by marekflys, Today, 03:07 PM
    0 responses
    10 views
    0 likes
    Last Post marekflys  
    Started by GregoryBaskin, Today, 02:51 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Tyler  
    Working...
    X