pannet1 / telegram-trades

get calls from telegram and place traders
0 stars 2 forks source link

Issues with Exits and TSL after MKT change implementation #13

Closed ravikanthvishnubhotla closed 6 months ago

ravikanthvishnubhotla commented 6 months ago

2nd Lot is not trailed to cost after 1st Lot Exit. E-Trail Error Observed Can you pls check for 2nd Lot handling. Is there any change with 2nd Lot handling after Market Entry changes were done? Can you pls verify the code for 2nd Lot trail SL to cost and exit @ 2nd Target.

There are no followup signals in Json file except these

{
    "channel": "Premium jackpot",
    "id": 1171496797439262,
    "symbol": "NFO:BANKNIFTY08MAY24C48900",
    "entry_range": "560|565",
    "target_range": "590.0|635.0|665.0|765.0|815.0",
    "sl": 540,
    "quantity": "15|15|15|15|15",
    "action": "Buy",
    "timestamp": "2024-05-06 09:29:34",
    "q1": 15,
    "q2": 15,
    "tq": 30,
    "fn": "E-TRAIL",
    "price": 0.0,
    "ltp": 617.1,
    "pnl": 18513.0,
    "entry": {
        "symbol": "BANKNIFTY08MAY24C48900",
        "quantity": 30,
        "side": "B",
        "price": "0.00",
        "trigger_price": "00.00",
        "average_price": "573.32",
        "filled_quantity": 30,
        "exchange": "NFO",
        "order_id": "24050600030061",
        "broker_timestamp": "06/05/2024 09:29:45",
        "product": "MIS",
        "remarks": "Premium jackpot",
        "order_type": "MKT",
        "Status": "complete"
    },
    "stop": {
        "symbol": "BANKNIFTY08MAY24C48900",
        "quantity": 30,
        "side": "S",
        "price": "539.95",
        "trigger_price": "540.00",
        "average_price": "0.00",
        "exchange": "NFO",
        "order_id": "24050600030921",
        "broker_timestamp": "06/05/2024 09:30:03",
        "product": "MIS",
        "remarks": "Premium jackpot",
        "order_type": "SL",
        "Status": "trigger pending"
pannet1 commented 6 months ago

according to this the target is reached, we are supposed to modify stop loss qty from 30 to 15. that did not happen, but why ? is this related to where the market is and what our target 1, price is ?

ravikanthvishnubhotla commented 6 months ago

as per the Market and Telegram Channel, T1 is reached. This is visible from both Output file and Telegram Snapshot. Another worry is there is no Exit on SL also..Can you check this image

ravikanthvishnubhotla commented 6 months ago

Could you check the code for any deviations?

pannet1 commented 6 months ago

unfortunately, could not lay hands on the log file.

pannet1 commented 6 months ago
[2024-05-06 09:30:16,861] DEBUG: modify SL to TGT]
[2024-05-06 09:30:16,861] INFO: modify resp: None]
[2024-05-06 09:30:16,861] INFO: stop loss order: {'symbol': 'NFO:BANKNIFTY08MAY24C48900', 'side': 'S', 'quantity': 15, 'price': -0.05, 'trigger_price': 0.0, 'order_type': 'SL', 'product': 'N', 'remarks': 'Premium jackpot'}]

seems both modification did not happen as well as new stop is also not placed

pannet1 commented 6 months ago

since the telegram call price is stored as 0, which is the highest of price, trigger_price in case of market orders, we had lot of issues. this is fixed now.