Need some help

 
I have managed to program my first EA looks ugly but works great.I have too problems 1 I want to have my lots set by percentage of equity and 2 I can set an overall maxlot but I want to have separate ones for long and short trades. any help would be greatly appreciated.
 
In order to help you help yourself, the following elements will be present in your lots function. Risk %, Account Balance, Relative StopLoss, 5 Digit Adjust Factor, Tick-Value, Tick-Size. CB
 
hello..i'm new here...actually i need some help on creating script, anyone could assis me?
Reason: