OptimalF isn't working for me. I have set up a slider for my script that changes the margin between 1 and 20. It works ok down to about 5 but anything under that will not vary the capital required figure. Is this because it has reached the minimum margin amount to place a 0.01 trade and so can't go lower?

The capital required is a fraction over what I have available so I either need to be able to vary the script to trade with smaller amounts or deposit another few hundred quid.

JCL, thanks again for your patience with this. The tutorials and manual answer a lot of questions but the answers are not always clear for a beginnner especially when it comes to money management for a trader used to mt4.