suryadi Posted September 9, 2010 Report Share Posted September 9, 2010 i hope senior here can help me...i want to protect lock account balnce with percent..and if i have open order more than 7... for example..if i want to protect 50% of my account balance..before i use this code... double ld_64 = AccountBalance() * ProtectionPercentage / 100.0; if (ProtectionPercentage > 0.0) { if (AccountEquity() <= ld_64) { CloseAll(); return (0); } } in backtest look no problem... when in real trade and re-quote situation this code can not work perfect.. because always can not close all my open orders..and i lost more than protection.. can senior here help me to code..the lock function for this? if still have floting lost orders protection value used Percentage of last account balance... until all lost orders have closed...than protection value will change follow the remaining account balance... in other word update protection value just in 2 situation: 1.if account balance was grow... 2.if in lost situation..protection value will used the last highest account balance...until all lost orders closed.. than update protection value after that. thank you..... Quote Link to comment Share on other sites More sharing options...
suryadi Posted September 24, 2010 Author Report Share Posted September 24, 2010 please help senior2 all ... how to code to get the highest level value of buy orders ... when in floating situation.. or sell at the lowest ... if i have many floating position? please help ... thanks .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.