Calculating the value of 1 lot. Is there such a script ?

 
Greetings,

I would like to calculate the value of one 1 lot (in US dollars) of each pair or commodity that I trade on, and
to place that value at the corner of my screen.

Is there such script already ?

James
 

Something like this script?

int start(){

   string str="";
   str= str + "MODE_DIGITS="        + DoubleToStr(MarketInfo(Symbol(),MODE_DIGITS),0)          +"\n";
   str= str + "MODE_SPREAD="        + DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD),0)          +"\n";
   str= str + "MODE_STOPLEVEL="     + DoubleToStr(MarketInfo(Symbol(),MODE_STOPLEVEL),0)       +"\n";
   str= str + "MODE_FREEZELEVEL="   + DoubleToStr(MarketInfo(Symbol(),MODE_FREEZELEVEL),0)     +"\n";
   str= str + "MODE_TICKVALUE="     + DoubleToStr(MarketInfo(Symbol(),MODE_TICKVALUE),Digits)  +"\n";
   str= str + "MODE_TICKSIZE="      + DoubleToStr(MarketInfo(Symbol(),MODE_TICKSIZE),Digits)   +"\n";
   str= str + "MODE_POINT   ="      + DoubleToStr(MarketInfo(Symbol(),MODE_POINT),Digits)      +"\n";
   str= str + "MODE_MINLOT="        + DoubleToStr(MarketInfo(Symbol(),MODE_MINLOT),3)          +"\n";
   str= str + "MODE_MAXLOT="        + DoubleToStr(MarketInfo(Symbol(),MODE_MAXLOT),3)          +"\n";
   str= str + "MODE_LOTSTEP="       + DoubleToStr(MarketInfo(Symbol(),MODE_LOTSTEP),3)         +"\n";
   str= str + "MODE_LOTSIZE="       + DoubleToStr(MarketInfo(Symbol(),MODE_LOTSIZE),0)         +"\n";
   str= str + "MODE_MARGINREQUIRED="+ DoubleToStr(MarketInfo(Symbol(),MODE_MARGINREQUIRED),2)  +"\n";
   Comment(str);
   
   return(0);
}

Just exactly what you mean by "the value of 1 lot" is unclear to me.

 
JJF:
Greetings,

I would like to calculate the value of one 1 lot (in US dollars) of each pair or commodity that I trade on, and
to place that value at the corner of my screen.

Is there such script already ?

James

What you only need is ...

MarketInfo(Symbol(),MODE_MARGINREQUIRED)

If your account is in US$, that function will return in US$, if your account is in EUR, then that function will return in EUR and you have to convert it to US$ equivalent.

:)

 
onewithzachy:

What you only need is ...

If your account is in US$, that function will return in US$, if your account is in EUR, then that function will return in EUR and you have to convert it to US$ equivalent.

:)

This is why I queried what the OP means. You have interpreted it to mean the margin required, but that is not "the value of 1 lot", it is the margin required, something else entirely. The value of 1 Industry Standard Lot of USDCHF is 100,000 USD. It may well be that the margin is what the OP wants, but as traders we need to be clear about what we are doing and saying.

(Some brokers refer to mini-lots of 10,000 units of the base currency as lots, just to confuse people!)

 
onewithzachy:

What you only need is ... MarketInfo(Symbol(),MODE_MARGINREQUIRED)

:)


Hi onewithzachy,

For EURUSD, the answer should be 10. The above function returns 1000.
I also checked it for FT_Gold. It is 3,125..

I'm not sure that this is the correct number. It doesn't match.

James
 
JJF:


Hi onewithzachy,

For EURUSD, the answer should be 10. The above function returns 1000.
I also checked it for FT_Gold. It is 3,125..

I'm not sure that this is the correct number. It doesn't match.

James

10 ?, 1000 ?

My broker is Alpari UK, standard US account. That func on EURUSD return 251.1, both on demo and live. I open 1 lot EURUSD on demo, and margin used is $ 251.1.

What is your broker anyway ?.

Files:
 
dabbler:

[...] The value of 1 Industry Standard Lot of USDCHF is 100,000 USD. [...]

? Surely it's 100,000 CHF. For example, on a USD account, I buy 1 lot USDCHF at 0.95423 and close/sell at 0.95390. I have lost 33 Swiss francs. The hit to my USD account is 33 CHF at the current exchange rate, which is USD 34.59.

Taking another example, let's say that I have an EUR account, and I buy 1 lot USDCHF at 0.95447 and close/sell at 0.95419. I have lost 28 Swiss francs. The hit to my EUR account is 28 CHF at the current EURCHF rate. If that's 1.20087, then my loss is EUR 23.31.

 
onewithzachy:

10 ?, 1000 ?

My broker is Alpari UK, standard US account. That func on EURUSD return 251.1, both on demo and live. I open 1 lot EURUSD on demo, and margin used is $ 251.1.

What is your broker anyway ?.



Maybe I did not expressed myself clearly.

I want to know how much money will gain a trade of 1 lot when it advances 1 pip.
For EURUSD, this value is $10.

Now, I want a function or EA to find this ($) value for each of my pairs or commodities.

James

 
JJF:


Maybe I did not expressed myself clearly.

I want to know how much money will gain a trade of 1 lot when it advances 1 pip.
For EURUSD, this value is $10.

Now, I want a function or EA to find this ($) value for each of my pairs or commodities.

James

Ooo.. now you're talking. it's MarketInfos's TICK_SIZE, but also look at TICK_VALUE. TICK_VALUE in Alpari UK XAUUSD is 5 points, so every tick is not 1 points, Ask dabbler opinion about that :( .

See them at my account details, and it's calculated in Points not pips.

 
JJF:


Maybe I did not express myself clearly.

yes, big time.

Read this ...

http://www.babypips.com/school/lots-leverage-and-profit-and-loss.html

and this

http://www.chartfilter.com/Trading-Guide/forex-lot-sizes-and-leverage.html

With an account in USD, any pair that ends in USD (eg EURUSD, AUDUSD, GBPUSD) is going to have the same cost per pip. Try it on a demo account.

Then you can use the script I gave you above and look at the MODE_TICKVALUE, which is the cost per point expressed in your account currency.

 
JJF:

I want to know how much money will gain a trade of 1 lot when it advances 1 pip.
For EURUSD, this value is $10.

Tick value must be used in a ratio https://www.mql5.com/en/forum/133792/page3#512466
Reason: