Closed amolkittur closed 2 months ago
I fixed the issue with yfinance but pushed the code before this issue was created it is pushed to feat- pystocks
Please check @amolkittur
@omkarh25 We are able to place the orders for the equity module. We need to make a few changes in the firebase so i am waiting for the admin page to be completed so that we can make the changes in the firebase without touching it
There are two scenarios where the code fails to handle the qty
field in Firebase correctly:
First-time execution:
qty
field doesn't exist in Firebase initially.qty
while executing the strategy.Subsequent executions:
qty
field exists in Firebase.qty
with available free cash.qty
, it uses the previous value.Reload the Firebase database before placing orders to ensure the most up-to-date data is used.
qty
field).qty
value being used).The code should always use the most recent data from Firebase when calculating and updating the qty
field.
This issue affects the accuracy of order placement and may lead to unexpected behavior in the trading strategy.
@1Chinmay1
I have made some changes in the Stoploss function.
Check the functions and also the values for all the three types of stoploss.
@amolkittur ok will check and test it once
@amolkittur
Tested the stoploss function
tested with entry price as 100 Rs
short term SL multiplier is 9% Mid term SL multiplier is 18%
Case1: ltp is 95rs
for short_momentum: SL is 91 rs for mid_tfema: SL is 82 for mid_tfMomentum: 82
case 2: ltp is 120rs
for short_momentum: SL is 109.0 for mid_tfema: SL is 100.0 for mid_tfMomentum: 100.0
case 3:
ltp is 110rs
for short_momentum: SL is 100.0 for mid_tfema: SL is 91.0 for mid_tfMomentum: 82.0
Assuming the entry for a stock was on Day 1 at 100 rs and SL multiplier is set to 10% and the Stop loss type is full trailing SL so for Day 1 SL is 90
Day 2: stock gaped up by 10% hence the SL shifts to 100
Day 3 stock has gaped down by 11% Ideally in this case the SL should be hit and trade should be exited but what happens is SL changes to 90
The code is generating the reports with the new database and firebase format. Also the stoploss function has been tested
Closing this issue as all the tasks required to pass the Phase 1 are complete
42
Description
This issue outlines the tasks involved in testing the equity module's order placement functionality. It includes steps from running the main equity module to updating the database at the end of the day.
Tasks
Run the Equity Main Module
Calculate Quantity in Equity File
Place Orders
Update Trade State
Handling Exit Orders
Handling Non-exit Orders
End-of-Day Updates