"""Execute a closed-bar signal at the next open.

No trade can use the current closing signal at an already elapsed opening price.
All inputs are synthetic teaching examples. Run: python 40_next-open-execution.py
"""
from tv_math import *

v=equity_backtest([100,110,90],[105,100,95],[1,0,0],1000,1,0)
assert v['net']==-22 and v['trades'][0]['entry']==1
print(v)
