expand_entries_and_exits#

API documentation for tradeexecutor.analysis.single_pair.expand_entries_and_exits Python function.

expand_entries_and_exits(state, token_quantizer=Decimal('0.000001'))[source]#

Write out a table containing entries and exists of every taken position.

  • Made for single pair strategies

  • Entry and exit are usually done using the close value of the previous candle

  • Assume each position contains only one entry and one exit trade

Returns:

DataFrame indexed by position entries

Parameters:

state (State) –

Return type:

DataFrame