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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        651 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X