I'd like to share my indicator with you. I'm using it on FxPro (6 digit broker). Feel free to modify it's code, it's quite easy to understand imho. Leave a comment about your opinions, ideas. Thanks!
On the picture you can see 2 horizontal lines, one red and a green line. Red line is moving stoploss, the green one is the target price. 'Current price line' can be moved too, but it is following the current price by default, so you can do calculations any time.
More info and download URL: