Hi,
If you have 2 contracts and scale them out, is there any function like barssinceexit() that returns the number of bars ago at which the "1st contract" being scaled out?
barssinceexit(1) doesn't work under this circumstance, your position has to be flat first before it may return anything. Thanks.
-K
barssinceexit() for multiple contracts scaling out [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: barssinceexit() for multiple contracts scaling out [SOLVED]
PosTradeExitBar returns the bar number of an exit trade. `PosTradeExitBar(1, 0)` for example returns the bar number of the first entry of the previous position.If you have 2 contracts and scale them out, is there any function like barssinceexit() that returns the number of bars ago at which the "1st contract" being scaled out?
barssinceexit(1) doesn't work under this circumstance, your position has to be flat first before it may return anything. Thanks.
And `PosTradeExitBar(1, PosTradeCount(1) - 1)` returns the bar number of the last exit from the previous position.