AFL coding for Intraday - Back Testing

First of all, ApplyStop() does NOT return any value so it is incorrect to use it in "OR" / "AND" statements. It is instruction ("switch") for the backtester. It just turns ON stops during backtest. The stop exits are added to existing rules so they work like "OR" without actually writing "OR" statements.

For proper usage examples see http://www.amibroker.com/f?applystop

See also https://forum.amibroker.com/search?q=applystop

Secondly please use code tags.