I believe this has already been answered in the following post:
But I just wanna confirm before I go writing new code.
notify_trade()is only called on the complete closing of a position, so if you have a strategy that for example buys XYZ stock once, but closes it over multiple signals, the
notify_trade()will not be called till the last share of XYZ is sold?
notify_trade() is only called on the complete closing of a position
- When a trade is started
- When a trade is closed
but closes it over multiple signals,
You know you are closing it, but the platform cannot know it. A
Trademay go down from having a size of
1. Is that closing? No. Because it may go again up to