Error in making GTT orders

rajdeep74
rajdeep74 edited April 2020 in PHP client
Hello sir ,
I am passing this condition in
Array
(
[trigger_type] => two-leg
[exchange] => NSE
[tradingsymbol] => HINDPETRO
[last_price] => 183.55
[trigger_values] => Array
(
[0] => 175
[1] => 196
)

[orders] => Array
(
[0] => Array
(
[tradingsymbol] => HINDPETRO
[exchange] => NSE
[quantity] => 1
[transaction_type] => SELL
[order_type] => LIMIT
[price] => 175
[product] => CNC
)

[1] => Array
(
[tradingsymbol] => HINDPETRO
[exchange] => NSE
[quantity] => 1
[transaction_type] => SELL
[order_type] => LIMIT
[price] => 196
[product] => CNC
)

)

[condition] => Array
(
[exchange] => NSE
[tradingsymbol] => HINDPETRO
[last_price] => 183.55
[trigger_values] => Array
(
[0] => 175
[1] => 196
)

)

)

in

placeGTT params but i am getting error

"Error: Invalid condition params."

Why so ??
Tagged:
  • rajdeep74
    This is json format

    {"trigger_type":"two-leg","exchange":"NSE","tradingsymbol":"HINDPETRO","last_price":"183.55","trigger_values":["175","196"],"orders":[{"tradingsymbol":"HINDPETRO","exchange":"NSE","quantity":1,"transaction_type":"SELL","order_type":"LIMIT","price":"175","product":"CNC"},{"tradingsymbol":"HINDPETRO","exchange":"NSE","quantity":1,"transaction_type":"SELL","order_type":"LIMIT","price":"196","product":"CNC"}],"condition":{"exchange":"NSE","tradingsymbol":"HINDPETRO","last_price":"183.55","trigger_values":["175","196"]}}
  • rhnvrm
    Hey

    Based on the json format you shared above, my guess is that you have incorrectly given the values as strings:
    ["175","196"]

    Also, I'm not sure if you are using the PHP client correctly. Please refer to the example (https://github.com/zerodhatech/phpkiteconnect/blob/ed5674855e1bc759013cf67bf0111f812d62bece/kiteconnect.php#L877) in the docs.
  • rajdeep74
    Thanks , Using as number solved the error .
This discussion has been closed.