Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PLACE order will not accept double value

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

    PLACE order will not accept double value

    the following code works

    WriteFile("oiflongstoplimitPlace.txt", "PLACE;"+Account.Name+";"+Instrument.FullName+";"+ "SELL;"+activeHEDGEqty+";STOPLIMIT;
    1218.00;1218.50;DAY;;"+HEDGE_orderId_STOP+";"+acti veHEDGEatm+";"+
    HEDGE_atmStrategyId_STOP );

    this code however gets an error 'invalid limit price'

    private double HEDGE_stopPrice = 0;
    private double HEDGE_limitPrice = 0;
    ...............
    HEDGE_stopPrice = 1218.50;
    HEDGE_limitPrice = 1218.00;
    WriteFile("oifshortstoplimitPlace.txt", "PLACE;"+Account.Name+";"+Instrument.FullName+";"+ "SELL;"+activeHEDGEqty+";STOPLIMIT;
    HEDGE_limitPrice;HEDGE_stopPrice;DAY;;"+HEDGE_orde rId_STOP+";"+activeHEDGEatm+";"+
    HEDGE_atmStrategyId_STOP );

    the variables are declared as 'double' however are not accepted as 'decimal' values required by the PLACE statement

    also, the Orders tab shows different values for limit and stop for the code that does work...i.e. 1212.00 limit and 1217.00 ...Accepted.but not close ....and the SLM order is successfully placed on charttrader chart at 1218.50 as ordered

    makes no sense...

    #2
    Hi ATI user, sorry I'm not following you here :

    1. Have you tried declaring the vars as decimal type then instead of double?

    2. So the resulting order is visualized in ChartTrader differently than outlined in the Orders tab? Are you sure you compare the exact same order then?

    Thanks,

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi ATI user, sorry I'm not following you here :

      1. Have you tried declaring the vars as decimal type then instead of double?

      2. So the resulting order is visualized in ChartTrader differently than outlined in the Orders tab? Are you sure you compare the exact same order then?

      Thanks,
      1. duh....never used decimal before...always either int or double....where should decimal be used beside Place order statement

      2. yes...plot on charttrader is correct however Order tab values are not even close...yes same order...when send screen shot when i test with decilmal

      thanks

      Comment


        #4
        Simply define the variable then as decimal in the first place, or cast the value to a decimal.

        (decimal) *your double value here* - would be the casting.

        Can you please send me your logs / trace to support so I can check what exact order is being issued?

        Thanks,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        65 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X