Help on Shi-Channel breakout

 

Hi,

I've found a very good Shi-Channel indicator, which I have attached here for reference.

How could I write an MQL code to detect a breakout on either side? I'm sorry if this is a redundant question, but honest-to-god, I've been google-ing for hours and not found really helpful info...

I'd like to write something like:

if (ShiBreakout("UP")) DoThis(); else if (ShiBreakout("DOWN")) DoThat(); else DoSomethingElse();

Of course my problem is with the ShiBreakout(string Direction); part... Programming-wise, how do you calculate wether the price has broken out of the channel?

Thanks,

AnDr0id

Files:
 

Use ObjectGetValueByShift() to find the values of the channel lines at the current bar.

Compare that value to the current Bid to dtermine the relationship of current price to the channel lines.

Reason: