strategy – Basic strategy classes

Strategies are the classes that you define that implement the trading logic, when to buy, when to sell, etc.

Buying and selling can be done in two ways:

  • Placing individual orders using any of the following methods:
  • quantworks.strategy.BaseStrategy.marketOrder()
  • quantworks.strategy.BaseStrategy.limitOrder()
  • quantworks.strategy.BaseStrategy.stopOrder()
  • quantworks.strategy.BaseStrategy.stopLimitOrder()
  • Using a higher level interface that wrap a pair of entry/exit orders:
  • quantworks.strategy.BaseStrategy.enterLong()
  • quantworks.strategy.BaseStrategy.enterShort()
  • quantworks.strategy.BaseStrategy.enterLongLimit()
  • quantworks.strategy.BaseStrategy.enterShortLimit()

Positions are higher level abstractions for placing orders. They are escentially a pair of entry-exit orders and provide easier tracking for returns and PnL than using individual orders.

Strategy

Position