
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
DO NOT DO THIS WITH REAL MONEY.
DO YOU WANT TO LOSE 10 % or OPEN POSITION WITH 10% ? (answer : the first one !)
I want to open position with 10% the same way someone can deposit $1000 in their account and open positions with 0.1 lot(10% if leverage is 1:100).
onewithzachy you are right i did modify it to the below and it worked but the strategy test came out poorer i guess its best to use fixed lots.
Everything works fine if i set a fixed lot size its fine but i want a dynamic lot size. So i thought out the above script but it does'nt work and i dont know the problem. @raptor i want to use $100 of the $1000 balance which i understand is 0.1 lot since my leverage is 1:100 but i want it dynamic so that if the system profits and balance becomes higher say new balance becomes $2000 i want it to now open trades with $200(0.2 lot) respecting the percentage i set i.e. 10%, 20% or any of balance/margin i set. @ onewithzachy ordersend is fine since it works if i set fixed lot size i.e. but when i try to dynamicise it like below it says wrong lot size. My account is micro and supports minimum 0.01 lot. Also this returns the same error while its even simpler Please read comments i have included in the code to understand better.
No wait it did add some turbo i had tested it wrongly. It would be great if i could calculate it using one formula rather than tons of if statements. Is it possible to derive a formula?
Which is the safest way?