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

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-17-2018, 12:57 AM.

    #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-22-2018, 12:46 AM. 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 Christopher_R, Today, 12:29 AM
        0 responses
        7 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,235 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        3 views
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        7 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,415 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X