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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        60 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        145 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X