It give the "Lots" we entered to lot first, and then give a value to lot again according to account free margin, the previous value is covered by it right? so is that necessary to enter a Lots at the EA start ?
It's from the sample Moving Average EA in MT4 program.
I took course of C programming...and back here again lol..
lot is not used between the 1st and 2nd. double lot=Lots; // the 1st int orders=OrdersHistoryTotal(); // history orders total int losses=0; // number of losses orders without a break //--- select lot size lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1); // the 2nd
So remove it. And then check if Lots is used anywhere. int orders=OrdersHistoryTotal(); // history orders total int losses=0; // number of losses orders without a break //--- select lot size double lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1); // once
- Calculate your risk properly.
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip)
- Do NOT use TickValue by itself - DeltaPerLot
- You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out

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
Thanks a lot for help