Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problem with EnterLongStop

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

    problem with EnterLongStop

    Hello,

    my strategy is very simple:

    It will place only 1 order and this is

    entryStopOrder=EnterLongStop(BarsInProgress,true,DefaultQuantity,stopprice,"Stop loss");

    the strategy will initially stay flat as this stop buy order is placed distant from the current ask.

    As soon as I place this order I get an error message
    Order rejected - reason:Invalid value in field # 99 (201) Affected Order: Buy 1 Stop @ 1,3648

    and the strategy stops.


    I have traced down the problem to the
    internal PlaceOrder method:

    after my call to EnterLongStop PlaceOrder is called 2 times, the first time with the correct parameters, but the second time with a wrong parameter,stop price=+infinito and this causes the error then.


    Please explain what is the problem here.

    Best regards

    attached the log (together with output window output!)

    10.33.10 Order Order rejected - reason:Invalid value in field # 99 (201) Affected Order: Buy 1 Stop @ 1,3648
    10.33.10 Order Order='264388347' Name='Stop loss' New State=Rejected Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=OrderRejected Native error='Order rejected - reason:Invalid value in field # 99 (201)'
    OnOrderUpdate stopprice=1,3648entryStopOrder:Order='264388347 Name='Stop loss' State=Accepted Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='82c56a73a2c94f44a85dc587aec144ef' Gtd='01/01/0001 0.00.00'
    10.33.10 Order Order='2643883479' Name='Stop loss' New State=Accepted Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    10.33.10 Order Order='264388347' Name='Stop loss' New State=PendingChange Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    10.33.10 Order Order='264388347' Name='Stop loss' New State=PendingChange Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=+Infinito Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

    OnOrderUpdate stopprice=1,3648entryStopOrder:Order='264388347' Name='Stop loss' State=Accepted Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='82c56a73a2c94f44a85dc587aec144ef' Gtd='01/01/0001 0.00.00'
    10.33.10 Order Order='264388347' Name='Stop loss' New State=Accepted Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    10.33.10 Order Order='264388347' Name='Stop loss' New State=PendingSubmit Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    10.33.10 Order Order='d2267554c0a94e1ea979ef63736d33f9' Name='Stop loss' New State=PendingSubmit Instrument='6E 06-09' Action=Buy Limit price=0 Stop price=1,3648 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    10.33.10 Amended matching order: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=+Infinito SignalName=Stop loss' FromEntrySignal=''

    10.33.10 Entered internal PlaceOrder() method at 19/05/2009 10.33.10: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=+Infinito SignalName='Stop loss' FromEntrySignal=''
    10.33.10 Entered internal PlaceOrder() method at 19/05/2009 10.33.10: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1,3648 SignalName='Stop loss' FromEntrySignal=''

    enter long stop 1,3648 == Print() before EnterLongStop

    my call
    Print("enter long stop "+ stopprice.ToString());
    entryStopOrder=EnterLongStop(BarsInProgress,
    true,DefaultQuantity,stopprice,"Stop loss");

    10.33.09 Strategy Starting NinjaScript strategy 'ShortFollowUp/46a34e924dcb42939fbc2e5b5aa229eb' : On starting a real-time strategy - StrategySync=SubmitLive EntryHandling=AllEntries EntriesPerDirection=4 StopTargetHandling=ByStrategyPosition ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=False Set order quantity by=DefaultQuantity
    Last edited by zweistein; 05-19-2009, 05:31 AM.

    #2
    stop:

    seems to be an error in my code!


    Regards
    andreas

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    47 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    15 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X