pannet1 / telegram-trades

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

Exit did not happen on T1 and SL #10

Closed ravikanthvishnubhotla closed 4 months ago

ravikanthvishnubhotla commented 4 months ago

Exit for "NFO:BANKNIFTY08MAY24C48800" from Premium Jackpot, did not happen for both T1 (1st Lot ) and SL

Message from Signal File Premium jackpot 1171498705586731 NFO:BANKNIFTY08MAY24C48800 450 475.0|520.0|550.0|650.0|700.0 410 15|15|15|15|15 Buy 06-05-2024 14:47

from 450 it went past 475, 1st Lot did not exit and even on going below Sl of 410, position did not exit, i had exxited manually

tasks.json signals.csv

pannet1 commented 4 months ago

please post relevant task as well.

ravikanthvishnubhotla commented 4 months ago

There is only Buy Entry..No followup signals are captures in Json file for this call..That is the reason, i had posted full Json file

{ "channel": "Premium jackpot", "id": 1171498705586731, "symbol": "NFO:BANKNIFTY08MAY24C48800", "entry_range": "450", "target_range": "475.0|520.0|550.0|650.0|700.0", "sl": 410, "quantity": "15|15|15|15|15", "action": "Buy", "timestamp": "2024-05-06 14:47:35", "q1": 15, "q2": 15, "tq": 30, "fn": "XXX", "price": 0.0, "ltp": 450.8, "pnl": 0, "entry": { "symbol": "BANKNIFTY08MAY24C48800", "quantity": 30, "side": "B", "price": "0.00", "trigger_price": "00.00", "average_price": "449.30", "filled_quantity": 30, "exchange": "NFO", "order_id": "24050600296449", "broker_timestamp": "06/05/2024 14:47:38", "product": "MIS", "remarks": "Premium jackpot", "order_type": "MKT", "Status": "complete" }

pannet1 commented 4 months ago

did you see the fn marker which says xxx. also this is not the full activity on 1171498705586731. for that you need to copy till you get the closing bracket }. the closing } you see above for the entry ... not the whole task. once you start seeing like this, you will start educating us.

ravikanthvishnubhotla commented 4 months ago

As mentioned, there are no further messages tagged with this call in json file.. this is the issue observed since morning for multiple calls

pannet1 commented 4 months ago

so we got a buy message and then we got a cancel message. what are we supposed to do. We should immediately close the position right.

ravikanthvishnubhotla commented 4 months ago

There no Cancel message here..I think you were refering to XXX here..but in reality there is no Cancel message that had come..you can see from below snashots of Signal & output files.

Also need to know why Exit on SL is also not triggered

Below is from Signal file image

Below is from Output file

image

{ "channel": "Premium jackpot", "id": 1171498705586731, "symbol": "NFO:BANKNIFTY08MAY24C48800", "entry_range": "450", "target_range": "475.0|520.0|550.0|650.0|700.0", "sl": 410, "quantity": "15|15|15|15|15", "action": "Buy", "timestamp": "2024-05-06 14:47:35", "q1": 15, "q2": 15, "tq": 30, "fn": "XXX", "price": 0.0, "ltp": 450.8, "pnl": 0, "entry": { "symbol": "BANKNIFTY08MAY24C48800", "quantity": 30, "side": "B", "price": "0.00", "trigger_price": "00.00", "average_price": "449.30", "filled_quantity": 30, "exchange": "NFO", "order_id": "24050600296449", "broker_timestamp": "06/05/2024 14:47:38", "product": "MIS", "remarks": "Premium jackpot", "order_type": "MKT", "Status": "complete" } }, { "channel": "Premium jackpot", "id": 1171498792280847, "symbol": "BFO:BANKEX2450655500CE", "entry_range": "8|10", "target_range": "15|20", "sl": 0.5, "quantity": "15|15", "action": "Buy", "timestamp": "2024-05-06 15:02:02", "q1": 15, "q2": 15, "tq": 30, "fn": "rejected", "price": 0.0, "ltp": 14.4, "pnl": 0 } ]

pannet1 commented 4 months ago

i may have used the previous cancel message here, because it is from the same channel.

ravikanthvishnubhotla commented 4 months ago

did not understand..does it mean is there any changes to the code to be done?..As mentioned, this had happened with almost all the calls today..Does this require any fix at your end

ravikanthvishnubhotla commented 4 months ago

Also need to know why Exit on SL is also not triggered??

ravikanthvishnubhotla commented 4 months ago

Below error was visible in run alog bat..thought it would give some insight

--- Logging error --- Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\logginginit.py", line 1083, in emit msg = self.format(record) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\logginginit.py", line 927, in format return fmt.format(record) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\logginginit.py", line 663, in format record.message = record.getMessage() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\logginginit.py", line 367, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Call stack: File "C:\py\venv\telegram-trades\telegram_trades\main.py", line 545, in run() File "C:\py\venv\telegram-trades\telegram_trades\main.py", line 520, in run task = obj_tasks._str_to_func(task) File "C:\py\venv\telegram-trades\telegram_trades\main.py", line 156, in _str_to_func return method(**task) File "C:\py\venv\telegram-trades\telegram_trades\main.py", line 310, in is_stop_or_target1 logging.error("placing trailing stop", resp) Message: 'placing trailing stop' Arguments: ([],)

pannet1 commented 4 months ago
[2024-05-06 14:47:38,070] INFO: entry args: {'symbol': 'NFO:BANKNIFTY08MAY24C48800', 'side': 'B', 'quantity': 30, 'price': 0.0, 'trigger_price': 0.0, 'order_type': 'MKT', 'product': 'N', 'remarks': 'Premium jackpot'}]
[2024-05-06 14:47:38,226] DEBUG: {'stat': 'Ok', 'NOrdNo': '24050600296449'}]
[2024-05-06 14:47:40,786] DEBUG: [{'symbol': 'BANKNIFTY08MAY24C48800', 'quantity': 30, 'side': 'B', 'price': '0.00', 'trigger_price': '00.00', 'average_price': '449.30', 'filled_quantity': 30, 'exchange': 'NFO', 'order_id': '24050600296449', 'broker_timestamp': '06/05/2024 14:47:38', 'product': 'MIS', 'remarks': 'Premium jackpot', 'order_type': 'MKT', 'Status': 'complete'}]]
[2024-05-06 14:47:42,808] INFO: entry found to cancel: {'symbol': 'BANKNIFTY08MAY24C48800', 'quantity': 30, 'side': 'B', 'price': '0.00', 'trigger_price': '00.00', 'average_price': '449.30', 'filled_quantity': 30, 'exchange': 'NFO', 'order_id': '24050600296449', 'broker_timestamp': '06/05/2024 14:47:38', 'product': 'MIS', 'remarks': 'Premium jackpot', 'order_type': 'MKT', 'Status': 'complete'}]
[2024-05-06 14:47:42,870] INFO: cancel entry: {'stat': 'Ok', 'nestOrderNumber': '24050600296449'}]

set off against the cancel message from the same channel.

ravikanthvishnubhotla commented 4 months ago

whether this cancel message is for SL or T1?