Open ddsaif opened 2 weeks ago
I will shares details about it after few minutes, but start writing the code
Okay...I have to make the changes in the same code or should, I create new controller for this ?
Can you please share the request body
create a request body by yourself as an example
which data, I have to use menace from that csv only which you have shared ?
I tried using this request body
{
"lad_id": 1283,
"stepSize": 40,
"targetPrice": 2000,
"orderSize": 1000
}
And the response which i am receiving is this
{
"message": "Ladder modified successfully",
"data": {
"lad_id": 1283,
"lad_user_id": 721,
"lad_position_id": 788,
"lad_ticker": "TCS",
"lad_name": 1,
"lad_status": "ACTIVE",
"lad_ticker_id": 9418,
"lad_exchange": "BSE",
"lad_trading_mode": "SIMULATION",
"lad_cash_allocated": 995000,
"lad_cash_gain": "-837271.73",
"lad_cash_left": 995000,
"lad_last_trade_price": 0,
"lad_last_trade_order_price": "3420.94",
"lad_minimum_price": 0,
"lad_extra_cash_generated": "4568.02",
"lad_realized_profit": "2199.42",
"lad_initial_buy_quantity": 133,
"lad_default_buy_sell_quantity": 3,
"lad_target_price": 10000,
"lad_num_of_steps_above": 44,
"lad_num_of_steps_below": 0,
"lad_cash_needed": "155636.54",
"lad_recent_trade_id": 2584,
"createdAt": "03-11-2024 17:40",
"updatedAt": "03-11-2024 17:45",
"lad_deleted": false,
"lad_initial_buy_price": 5000,
"lad_current_quantity": 175,
"lad_definition_id": 1389,
"lad_initial_buy_executed": true,
"lad_step_size": "112.79",
"lad_extra_cash_left": 0,
"lad_reinvest_extra_cash": false,
"lad_unsold_stock_cash_gain": "-839471.15",
"target_price_multiplier": 2,
"continue_trading_after_hitting_target_price": true,
"lad_recent_order_id": ""
}
}
"lad_default_buy_sell_quantity": 3,
"lad_step_size": "112.79",
"lad_target_price": 10000,
in your response these value is not updated, these means nothing is updated. Code is not working properly. and lad_default_buy_sell_quantity is as well as known as order_size.
The request body which, I am using is correct ?
yes
Now, I used this request body { "lad_id": 1283, "new_step_size": 150.00, "new_target_price": 12000.00, "new_order_size": 5 }
and the responce is this
"lad_default_buy_sell_quantity": 5, "lad_step_size": 150, "lad_target_price": 12000,
the values are changing
I will push my code on the github whatever changes I did please check it out and do let me know weather it is correct or not. the request and response body is this.
Request Body { "lad_id": 1283, "new_step_size": 170.00, "new_target_price": 1500.00, "new_order_size": 2000 }
and the response body is this
{ "message": "Ladder modified successfully", "data": { "lad_id": 1283, "lad_user_id": 721, "lad_position_id": 788, "lad_ticker": "TCS", "lad_name": 1, "lad_status": "ACTIVE", "lad_ticker_id": 9418, "lad_exchange": "BSE", "lad_trading_mode": "SIMULATION", "lad_cash_allocated": 995000, "lad_cash_gain": "-837271.73", "lad_cash_left": 995000, "lad_last_trade_price": 0, "lad_last_trade_order_price": "3420.94", "lad_minimum_price": 0, "lad_extra_cash_generated": "4568.02", "lad_realized_profit": "2199.42", "lad_initial_buy_quantity": 133, "lad_default_buy_sell_quantity": 2000, "lad_target_price": 1500, "lad_num_of_steps_above": 44, "lad_num_of_steps_below": 0, "lad_cash_needed": "155636.54", "lad_recent_trade_id": 2584, "createdAt": "03-11-2024 17:40", "updatedAt": "2024-11-07T11:29:37.420Z", "lad_deleted": false, "lad_initial_buy_price": 5000, "lad_current_quantity": 175, "lad_definition_id": 1389, "lad_initial_buy_executed": true, "lad_step_size": 170, "lad_extra_cash_left": 0, "lad_reinvest_extra_cash": false, "lad_unsold_stock_cash_gain": "-839471.15", "target_price_multiplier": 2, "continue_trading_after_hitting_target_price": true, "lad_recent_order_id": "" } }
As you have checked before the values which are not getting update. That values are getting change now.
we have to make a function as modify ladder. where user can modify stepsize or target price or order size in dd_ladder_implementation