How to setup a new base currency #568
-
|
Hi Got the system running on paper trading! Learing a ton about the theory and the code every day - still got a long way to go - but it is a challenge, and I am enjoying it! Hit an unexpected problem though; Stack handler crashed after IBKR warned that an order would be cancelled due to lacking margin. Looks like it is a problem with my base currency setup. I have setup the system using NOK. Added NOK as currency by addingNOK to 'pysystemtrade.sysbrokers.IB.ib_config_spot_FX.csv', thusly; Did the above before importing to db, and subsequently imported the NOK price history. Imported both from IBKR and for the more distant past, I grabbed daily prices from the Norwegian central bank. Prices from IBKR and from Norwegian bank were of the same size, and so I was hoping I had added it correctly. But, looking at the subsystem position table in the strategy report, the IVV was a much smaller number than ICV, so the implementation of the currency looks to be the problem. I a pure guess that the problem with my setup is the following line in 'pysystemtrade.sysbrokers.IB.ib_config_spot_FX.csv' insteadof This is my guess is that I do not see much more to change or configure. But be very grateful if you could give your opinion before I recompile everyting. FYI; I did declare the new base currency in private_config. Forgot to do it in the backtest_config_filename though, so that was another cock-up. (FYI - strategy report did report my Vol target calculation with NOK and correct notional capital) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
If I look at the currency config: That is telling me that IB don't know what eg HKDUSD is, so I have to download USDHKD and invert it. But for GBPUSD I can just get GBPUSD outright. So you should have eithier: or Depending on what IB recognises as a valid currency code. You will know if you have it right, because when you do this It will work and won't complain Then when you do this: .... but for NOK you should get the number of USD that one NOK would buy you (about 0.12). That means you have downloaded your historic data correctly from IB. You also probably want to plot the whole NOKUSD to make sure the backfilled rates are in line with IB. Hope that makes sense. |
Beta Was this translation helpful? Give feedback.
If I look at the currency config:
That is telling me that IB don't know what eg HKDUSD is, so I have to download USDHKD and invert it. But for GBPUSD I can just get GBPUSD outright.
So you should have eithier:
or
Depending on what IB recognises as a valid currency code.
You will know if you have it right, because when you do this