- ago
What is the equivalent in WL8. Is there an example. Thank you.

Best.
0
87
Solved
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 5.60% )
- ago
#1
Maybe the PowerPack's Bars Since Entry/Exit Block? Or are you looking for code-based equivalent?
0
- ago
#2
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.

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");
1
Best Answer
- ago
#3
Thank you
1

Reply

Bookmark

Sort