Indicators: Position Size Calculator - Based on VP money Management rules - page 3

To add comments, please log in or register
Jenns
5
Jenns  

Hi guys I love this indicator and it has been working really well in my testing phase, I just realized that it's throwing some error maybe someone can help me out.


The error is

2019.06.29 13:30:13.866 pos_size EURNZD,Daily: Error: can't create label! code #4200


Thank You!


Sepz
96
Sepz  
Hi there. I love the idea. I find it very useful.

I was wondering, if there is a way to space out the text from each other so it is easier to read? :)
jimmyruan
8
jimmyruan  

Hello,

I notice that ExCRate always return 1. This is catastrophic because $ 1 AUD isn't 1 JPY. 

The problem lies at 

ExCRate= MarketInfo(ExC,MODE_ASK);  

MT4's MarketInfo function returns 0 for all currencies and this problem was discusses in https://www.mql5.com/en/forum/154833 .

I added a print function after and found that it only return 1 for every currency i tested. 

if(AccntC!=CounterC)
    ExCRate= MarketInfo(ExC,MODE_ASK);                          //Get the correct FX rate for the Account to Counter conversion
if(ExCRate ==0) ExCRate=1.0;

Print(ExC + " is: " + ExCRate);

I manage to fix this by using iClose function.

ExCRate = iClose(ExC, 0, 0);
// ExCRate= MarketInfo(ExC,MODE_ASK);


Images: https://imgur.com/a/yhk1RW8 . Thanks

How to import bid/ask from another currency pair?
How to import bid/ask from another currency pair?
  • 2015.02.14
  • www.mql5.com
What code can accomplish importing the current bid and ask price of the currency pair that would be in the account base currency, and that would be...
123
To add comments, please log in or register