• 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

EnterShortStop is failing

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

    EnterShortStop is failing

    I do not understand why my EnterShortStop is failing: The code is:

    Print("Setting the stop order at " + (Close[2] - ( 1 * TickSize)) );
    Print("The current price is " + Close[0]);
    Print("Currant ask is " + GetCurrentAsk());
    Print("The time is " + Time[0]);
    entryOrder = EnterShortStop(1, (Close[2] - ( 1 * TickSize)), "MyStrat");

    When this code executes, the current prices is 2134.25, and the EnterStopOrder is 2132.75. So, the EnterStopOrder is 1.5 points under the current price when executed. The debugging output is:

    Setting the stop order at 2132.75
    The current price is 2134.25
    Currant ask is 2134.5
    The time is 9/20/2016 10:00:00 AM

    However, when the price does drop to my order price, at 2132.75, I get the error:

    Market Replay Connection. By stop or buy stop limit orders can't be place below the market, affected Order: BuyToCover 1 Stop @ 2128.75

    I'm made a video capture of this at: https://youtu.be/oZizaamVo4k

    Your help? Thanks,
    Last edited by timmbbo; 03-16-2018, 11:57 PM.

    #2
    Hello timmbbo,

    Thank you for your note.

    The code sample you provided calls method EnterShortStop, which would not give you an error about buy to cover. I would look through the script for any Close calls which are giving you that error.

    Without the full code we're unable to test on our end.

    If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

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

    Comment


      #3
      help for ninja trader

      I have stocks from multiple places and how do i sell it or buy more?
      Last edited by webdesignchennai; 03-21-2018, 11:46 PM. Reason: Content adding

      Comment


        #4
        Hello webdesignchennai,

        Thank you for your note.

        Would you please provide more information on what you're looking to do as well as how this pertains to automated strategy development?

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kevinenergy, Today, 03:34 PM
        0 responses
        5 views
        0 likes
        Last Post kevinenergy  
        Started by Bidder, Today, 01:50 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by markbb10, Today, 01:50 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by Orden33, Today, 10:09 AM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by martyn73, Today, 10:18 AM
        4 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X