What is the equivalent in WL8. Is there an example. Thank you.
Best.
Best.
Rename
Maybe the PowerPack's Bars Since Entry/Exit Block? Or are you looking for code-based equivalent?
Look at the example code (below) for BarsSinceLastExit(...). That should work for you.
You also might consider LastPosition?.ExitBar, but it might return -1 or null if it can't find one. Check the documentation.
You also might consider LastPosition?.ExitBar, but it might return -1 or null if it can't find one. Check the documentation.
CODE:
public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //wait at least 15 bars since the last exit of if any position (all symbols) if (BarsSinceLastExit(idx, 0) > 15) if (_rsi[idx] < 15) PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, "Waited 15");
Thank you
Your Response
Post
Edit Post
Login is required