How to rotation every n bar

at the backtestRotational mode, how can it rotation every n bar ? thanks a lot.

Consult documentation AFL Function Reference - ENABLEROTATIONALTRADING
There is scoreNoRotate that stops rotation.

YourOriginalScore = ...

DoRotate = ( BarIndex() % 10 ) == 0; // every 10-th bar

PositionScore = IIF( DoRotate, YourOriginalScore, scoreNoRotate );
3 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.