Trader order according to margin percentage

 

Hi,

I need a trade script that can be executed on the chart and allows you the adjust the lot size according to the percentage margin. For instance, If i want to execute a trade with 500% margin then I just execute the script and it calculates the absolute lot size automatically so that it suits a 500% margin.

Has anyone got such a script??

thanks a lot for your help