Download MetaTrader 5

Account Information

To add comments, please log in or register
GrumpyDuckMan
385
GrumpyDuckMan  

Hello everyone,

I have started to write some account management code, but I don't understand what exactly AccountStopoutLevel means, at the moment ASOL = 20.0.

The information in the reference manual says "The value of the Stop Out level."  Can someone please provide a more detailed explanation for me about it?

void Account_Management(){ACCname=AccountName();AccMargin=AccountMargin();AccountNum=AccountNumber();ACCPROFIT=AccountProfit();ACCcredit=AccountCredit();AccEquity=AccountEquity();
 AccountBal=AccountBalance();AccCurrency=AccountCurrency();ACCleverage=AccountLeverage();AccFreeMargin=AccountFreeMargin();ASOM=AccountStopoutMode();ASOL=AccountStopoutLevel();
 AFMM=AccountFreeMarginMode();
whroeder1
16105
whroeder1  
Risk depends on your initial stop loss and lot size.
  • 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 but it takes account of the exchange rates of the pair vs. your account currency.)
  • 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
Never used it, only the AccountFreeMarginCheck - Account  Information - MQL4 Reference. Follow the stop out link above.
GrumpyDuckMan
385
GrumpyDuckMan  
whroeder1:
Never used it, only the AccountFreeMarginCheck - Account  Information - MQL4 Reference. Follow the stop out link above.

Thank you whroeder1, for the every interesting insights. I will read up on them over the weekend.

Off topic:

I found a code that looks similar to this on the forum, I thought it was fairly use less, but I see a possible purpose for it now.

void OnInit()
  {
   ChartSetInteger(Chart_ID,CHART_SHOW_GRID,false);
   bool TF=ChartSetSymbolPeriod(chartid,charts,TIMEFRAME);
   if(AccountNumber()!=ALLOWED_ACCOUNT)MessageBox(Invalid,Account_Number_Wrong);
   if(AccountNumber()!=ALLOWED_ACCOUNT)
      return;
To add comments, please log in or register