5ymph0en1x/Heptet

Not placing orders

Opened this issue · 0 comments

Hi,

I've been testing your solution for a couple of days now, and although I think it might be a great tool for trading, it seems that I can't get it right....

First of all it barely gets a Beta under 1 to trade, and when it does in most cases will be this neutral felling to it.

If somehow will get into action and actually place a trade

p_value: 0.08963013915151219
Beta: [0.35512627]
NEUTRAL - Current holding: 0
Minute update...
Ready to analyze history...
EUR_JPY
C1: 1199
TS: 2019-12-17 21:17:00  /TE: 2019-12-18 18:56:00
GBP_JPY
C2: 1199
TS: 2019-12-17 22:56:00  /TE: 2019-12-18 18:56:00
X: 1201
Y: 1201
p_value: 0.09087981597641864
Beta: [0.35396983]
NEUTRAL - Current holding: 0
Minute update...
Ready to analyze history...
EUR_JPY
C1: 1199
TS: 2019-12-17 21:21:00  /TE: 2019-12-18 18:57:00
GBP_JPY
C2: 1199
TS: 2019-12-17 23:00:00  /TE: 2019-12-18 18:59:00
X: 1198
Y: 1198
p_value: 0.09444624003182783
Beta: [0.34829104]
Traceback (most recent call last):
  File "Trading_Model.py", line 250, in <module>
    EG_Test.process_trading(index=j, transaction_cost=0.000, **action_dict)
  File "/home/ftpuser/ml/STRATEGY/Cointegration.py", line 495, in process_trading
    order = self.gen_trade_signal(start_forward, end_forward, trade_th, stop_loss, transaction_cost)
  File "/home/ftpuser/ml/STRATEGY/Cointegration.py", line 204, in gen_trade_signal
    x, y = self.get_trade_sample(start, end)
  File "/home/ftpuser/ml/STRATEGY/Cointegration.py", line 133, in get_trade_sample
    assert start < end <= len(self.x), 'Error:Invalid Indexing.'
AssertionError: Error:Invalid Indexing.

I'm not sure if I do something wrong...