Hi,
Is there a way to find what the balance was after a deal finished in the OnTester method at the end of a backtesting pass?
I noticed when we traverse through the deal and their properties, in the documentation ENUM_DEAL_PROPERTY_DOUBLE doesnt have a resulting balance property.
1. Is there another property we can fetch to get the resulting balance after a deal , from OnTester method?
Or do we have to manually keep track of balance after every deal from onTick method?
2. in ENUM_DEAL_TYPE , what does DEAL_TYPE_BALANCE do? I didnt really understand the documentation description.
The documentation says "balance"
and there is also a credit enum which is described as "credit".
The tester says balance type for the :
- starting balance (Which simulates a deposit)
- our own deposit simulated in the tester
- the withdrawal too
bool DEPOSITED=false,TESTING=false; int OnInit() { DEPOSITED=false; TESTING=(bool)MQLInfoInteger(MQL_TESTER); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { } void OnTick() { if(TESTING){ if(!DEPOSITED){ DEPOSITED=true; TesterDeposit(1000000); TesterWithdrawal(100); //loop into the deals HistorySelect(0,TimeTradeServer()); Print("Deals to Scan "+IntegerToString(HistoryDealsTotal())); for(int i=0;i<HistoryDealsTotal();i++){ ulong T=HistoryDealGetTicket(i); if(T>0){ Print("Deal ["+IntegerToString(T)+"] ["+EnumToString((ENUM_DEAL_TYPE)HistoryDealGetInteger(T,DEAL_TYPE))+"] ["+DoubleToString(HistoryDealGetDouble(T,DEAL_PROFIT),2)+"]"); } } TesterStop(); } } }

Also if you want the final balance
double balance_read=(double)AccountInfoDouble(ACCOUNT_BALANCE); Print("Final binance "+DoubleToString(balance_read,2));
The documentation says "balance"
and there is also a credit enum which is described as "credit".
The tester says balance type for the :
- starting balance (Which simulates a deposit)
- our own deposit simulated in the tester
- the withdrawal too
Also if you want the final balance
i meant to say that there is no function that directly fetches the resulting balance after a deal took place. we have to manually to do the calculations
there is
double balance_read=(double)AccountInfoDouble(ACCOUNT_BALANCE);
if you want to control the behavior based on balance and equity of the system.
There is also
AccountInfoDouble(ACCOUNT_EQUITY);
there is
if you want to control the behavior based on balance and equity of the system.
There is also
i think you misunderstood me. I meant balance at end of a deal that occured many deals ago in the past. For example 10 deals ago what was the balance?
for machine learning?
you will have to log and track the deals yeah . (and then export it to files)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is there a way to find what the balance was after a deal finished in the OnTester method at the end of a backtesting pass?
I noticed when we traverse through the deal and their properties, in the documentation ENUM_DEAL_PROPERTY_DOUBLE doesnt have a resulting balance property.
1. Is there another property we can fetch to get the resulting balance after a deal , from OnTester method?
Or do we have to manually keep track of balance after every deal from onTick method?
2. in ENUM_DEAL_TYPE , what does DEAL_TYPE_BALANCE do? I didnt really understand the documentation description.