mhallsmoore / qstrader

QuantStart.com - QSTrader backtesting simulation engine.
https://www.quantstart.com/qstrader/
MIT License
2.9k stars 855 forks source link

TickSize, LotsMin, LotsStep #119

Closed lordillusions closed 7 months ago

lordillusions commented 8 years ago

Hi folks,

This supposed to be flagged as enhancement.

Need a way to describe the TickSize (Minimal change of Price), LotsMin(Minimal Volume to close a deal), LotsStep(minimal step of volume change to close a deal), LotsMax, etc...

Maybe this is the first step to support other types of stocks, as derivatives, forex, etc.

I like this project very much, hope to help more here.

femtotrader commented 8 years ago

Hi @lordillusions ,

I think the concept of Contract is missing currently in QSTrader.

Each ticker, should be linked to a Contract

This contract will have properties such as TickSize, LotsMin, LotsStep, LotsMax...

but also a ContractSize (a FOREX contract size being typically 100'000)

In MT, this is called contract specification

alexispetit commented 8 years ago

How about having a class Asset as a base class, then Stock, Future, Forex, Option, etc. inherit from it? Similar to what Quantopian/Zipline does. P&L and slippage calculations are based on the multiplier/currency/tick_size values provided to each asset, whether it is a stock, a future, etc.