@drayzen hahaha 
As I said, this is a year old project, I must recall what I was thinking:
The core principle is to sell RSI 70 and buy RSI 30 (block 11 downwards).
I like to use a trigger with rsi, for example: sell at 70, rsi comes back to 50 -> another sell at 70 is now allowed.
Rest of the blocks are to determine the main market direction, and to restrict selling an uptrend for example.
Block 2 downwards is checking how many consecutive days rsi is >50 and also price > BB (and vice versa for downtrend) Variables Dd = "days down" and Du = "days up"
Block 24 downwards is to find high and low point of the last swing (roughly)
Block 18 downwards is to calculate the midpoint of those highs and lows (variable "med"). This is used to restrict unwanted sells and buys..
To be honest, I doubt my main trend analysis does any good - the core principle of selling rsi 70 and buying rsi 30 with the trigger mechanism is quite good on its own.
I havent traded this, didn't trust this enough.
Initially wondering if a 'No Trade' instead of the 'Once per bar' would enable more opening opportunities? (just thinking of my own issues with having it first)
I have found it best to always use once per bar. "No trade" would maybe create 0.000001% better trading results, or maybe that much worse - in any case, the difference is not much but it would greatly slow down the backtesting.