Try to code a breakout

 
Hello,

I'll try to code a breakout, what I call a breakout.

If someone have already programmed this function and is willing to share it, he is  welcome. ^ ^

Breakout

 

 
I've done it in Pips/Points from the Lowest but never in Percentage. :)
 
If Bid > Lowest + ( (X / 100) * ( EntryPoint - Lowest) )   buy x lots
Reason: