Forum

Close Position by profit

Hi I have this code to close position when reach a specific profit(0.50) e loss(-10) buy when i run strategy tester i get profits like 2,3,4 and losses like -23,-12 Can someone help me, double TargetLoss=- 10 ; double TargetProfit= 0.50 ; double profit= AccountInfoDouble ( ACCOUNT_EQUITY )-

How objects work

hello i would like to know why we use ObjectsTotal(0)-1 when we loop objects instead of only Objects Total(0) and what is the function of _FUNCTION_ when printing error? Please