psemdel / py-trading-bot

Trading-bot in python using django, vertorbt lib and interactive-brokers
MIT License
166 stars 38 forks source link

How do get rid of this #25

Closed ben1628 closed 1 year ago

ben1628 commented 1 year ago

Using the dump data, I now getting this, I don't use CAC40 in exchange MONEP, how do I get rid of that, where are they located!

How about ^GDAXI, DJI etc. In general how do I add or remove those.

However, I don't see AAPL and TSLA showing up, I add those in Strat candidates under normal.

Thanks.

[2023-03-06 12:37:45,078: ERROR/ForkPoolWorker-7] Error 300, reqId 65: Can't find EId with tickerId:65
[2023-03-06 12:37:45,228: ERROR/ForkPoolWorker-7] Error 162, reqId 66: Historical Market Data Service error message:No market data permissions for MONEP IND, contract: Index(symbol='CAC40', exchange='MONEP')
[2023-03-06 12:37:45,337: ERROR/ForkPoolWorker-7] Error 354, reqId 67: Requested market data is not subscribed.Delayed market data is available.Error&MONEP/IND/natindex&MONEP/IND/Top&MONEP/IND/Top, contract: Index(symbol='CAC40', exchange='MONEP')
  0%|          | 0/1 [00:00<?, ?it/s]kPoolWorker-7]
^GDAXI:   0%|          | 0/1 [00:00<?, ?it/s]ker-7]
^GDAXI: 100%|##########| 1/1 [00:00<00:00,  2.02it/s]
^GDAXI: 100%|##########| 1/1 [00:00<00:00,  2.01it/s]
  0%|          | 0/1 [00:00<?, ?it/s]kPoolWorker-7]
^DJI:   0%|          | 0/1 [00:00<?, ?it/s]orker-7]
^DJI: 100%|##########| 1/1 [00:00<00:00,  2.04it/s]
^DJI: 100%|##########| 1/1 [00:00<00:00,  2.04it/s]
  0%|          | 0/1 [00:00<?, ?it/s]kPoolWorker-7]
psemdel commented 1 year ago

When you go in telegram.py there is report3.daily_report_index(["^FCHI","^GDAXI"]). It may be a cause.

Also delete the

            if kwargs.get("opening")=="9h":
                stockEx1=StockEx.objects.get(name="Paris")
                stockEx2=StockEx.objects.get(name="XETRA")

                c1 = Q(stock_ex=stockEx1)
                c2 = Q(stock_ex=stockEx2)

                indexes = Action.objects.filter((c1|c2)&c3)

You can even delete those indexes in the database. So you are sure that it won't be called by

indexes = Action.objects.filter(c3)

You can look in the pf. The checking is pf related, so even if you have AAPL in Strat candidates under normal it won't be checked if you don't have it.

ben1628 commented 1 year ago

Still seeing this but not the AAPL even after I add a new PF with AAPL. I don't think I understand what the proper way to do this!

[2023-03-06 19:18:03,529: ERROR/ForkPoolWorker-7] Error 300, reqId 293: Can't find **EId** with tickerId:293
[2023-03-06 19:18:04,085: ERROR/ForkPoolWorker-7] Error 162, reqId 296: Historical Market Data Service error message:No market data permissions for **SBF STK**, contract: Stock(symbol='**ENGI', exchange='SBF**')
[2023-03-06 19:18:04,427: ERROR/ForkPoolWorker-7] Error 354, reqId 297: Requested market data is not subscribed.Delayed market data is not available.ENGI SBF/TOP/ALL, contract: Stock(symbol='ENGI', exchange='SBF')
  0%|          | 0/1 [00:00<?, ?it/s]kPoolWorker-7]
LIN.DE:   0%|          | 0/1 [00:00<?, ?it/s]ker-7]
LIN.DE: 100%|##########| 1/1 [00:00<00:00,  1.43it/s]
LIN.DE: 100%|##########| 1/1 [00:00<00:00,  1.43it/s]
[2023-03-06 19:18:06,941: ERROR/ForkPoolWorker-7] Error 300, reqId 297: Can't find EId with tickerId:297
  0%|          | 0/1 [00:00<?, ?it/s]kPoolWorker-7]
HEN3.DE:   0%|          | 0/1 [00:00<?, ?it/s]er-7]
psemdel commented 1 year ago

It is looking for a stock (ENGI) in Paris and also LIN.DE in Xetra. Maybe just delete all pfs, there are not important. And create a new one normal_Nasdaq. Actually, I already thought that pfs are a bit over-complicated, but without them, it would become difficult to keep track of which stock is actually presently owned by a strategy...

ben1628 commented 1 year ago

No, it's fine. I just have to understand your thought process. You have quite a lot of stuff there, it will take me a while to understand them. Having said that, I think it's a good start.

Once I have a clean output, I will start looking at your codes in more details. For example, how often do you get data from IB/Yahoo, how often a signal is generated etc...

It's exciting to say the least.

ben1628 commented 1 year ago

Just got a alert saying Tesla is down 3%, that's very cool.

psemdel commented 1 year ago

The alerting part really works indeed :)