vsaveris / trading-technical-indicators

Trading Technical Indicators python library
https://www.trading-technical-indicators.org/
MIT License
114 stars 33 forks source link

Rework runSimulation method of the tti.indicators package, to consider portfolio when reacting in trading signals #6

Closed vsaveris closed 3 years ago

vsaveris commented 3 years ago

runSimulation method applies currently trading signals as they received without considering the current portfolio status (long and short positions). As a result the simulation outcome is not reliable.

The method should be updated so that the trading signals will be applied considering long and short open positions.

Target release 0.1.b3

Tasks:

vsaveris commented 3 years ago

Description of the new implementation of the runSimulation method:

Executes trading simulation based on the trading signals produced by the technical indicator, by applying an Active trading strategy. With a buy trading signal a new long position is opened. With a sell trading signal a new short position is opened. Opened positions are scanned on each simulation round, and if conditions are met (current stock price > bought price for opened long positions and current stock price < bought price for opened short positions) the positions are being closed. When a position is opened, the number of stocks is decided by considering the input arguments.

vsaveris commented 3 years ago

Development is done. Ready for test cases development.

vsaveris commented 3 years ago

The method requires further rework. The runSimulation method will become deprecated in the next beta release and it will be replaced by the getTiSimulation method. Details will be included in another issues ticket. This tickets is being closed.