molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Mon Apr 29, 2024 8:39 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Maximum percentage at risk
PostPosted: Sun Aug 17, 2014 6:20 pm 
Offline

Joined: Mon Aug 11, 2014 9:09 pm
Posts: 6
I can't get this feature to work. I made a simple .mol file but I can't get it to work there either. I'm always getting lots that are 0.01 in the mt4 strategy tester. Here is the file:


Attachments:
PAR.mol [8.84 KiB]
Downloaded 614 times
Top
 Profile  
 
 Post subject: Re: Maximum percentage at risk
PostPosted: Tue Aug 19, 2014 9:01 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
I tested it on my end and it works fine. Got 0.18 for micro and 0.2 for standard. In the Start icon Try setting account type to standard account.
The calculation is done like this:
lot=NormalizeDouble(AccountFreeMargin()*(MaximumPercentageatRisk/100)/1000.0,tmpdecimal);
Some mt4 servers does not give info to AccountFreeMargin() so you cannot get the calculation done. If your deposit is in USD it should be fine.

The stop at 3 pips will be rejected by the server. It is too small. Most server require 15 to 20 pips.


Top
 Profile  
 
 Post subject: Re: Maximum percentage at risk
PostPosted: Tue Aug 19, 2014 10:02 pm 
Offline

Joined: Mon Aug 11, 2014 9:09 pm
Posts: 6
The problem was that I used a demo account that use standard lots and I wanted to use micro lots. So I opened a new micro demo account and now it works. Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009