quantopian / zipline

Zipline, a Pythonic Algorithmic Trading Library
https://www.zipline.io
Apache License 2.0
17.77k stars 4.74k forks source link

Futures margin rates #624

Open npezolano opened 9 years ago

npezolano commented 9 years ago

Unlike equities, each future contract has a different initial and maintenance margin. Should this be incorporated somehow into Zipline?

https://www.interactivebrokers.com/en/?f=margin&p=fut

Somewhat related to #564

warren-oneill commented 9 years ago

I've heard it's currently in the works. @jfkirk should be able to give you more details. Personally I'd love to have the SPAN margin method implemented http://www.investopedia.com/terms/s/spanmargin.asp

jfkirk commented 9 years ago

@npezolano We are planning to incorporate a full margin system that would allow you to specify rates for individual Assets or classes of Assets. This would cover your use case.

Right now we are speccing this feature out (conducting user interviews and designing the API). Then we will begin development.

Self-assigning.

npezolano commented 8 years ago

Could this be incorporated into the metadata that gets passed into TradingEnviroment.write_data?

emretezel commented 4 years ago

until the margin feature is implemented for futures, is there any way we can limit the max leverage when running backtests with futures?