Q about MQL 4

 

When using Point in a math function such as *Point or /Point what is being referenced by the use of Point?

Thanks

Greg

 

Point

aghenry1:
When using Point in a math function such as *Point or /Point what is being referenced by the use of Point?

Thanks

Greg

The Point is "pip value" of the current symbol (chart) hosting your EA/Indicator/Script.

To get the Point of any chart use:

MarketInfo( "SYMOBL NAME - EX: USDCHF", MODE_POINT);

 

Could you show me an example?

mytakeProfit=Ask+TakeProfit*point

mytakeProfit=Bid-TakeProfit*point

Assuming present price is EURUSD 1.3140 and TakeProfit is 50

Thanks

Greg

 

To be more exact - Point is a built-in constant which represents the size of a pip relative to the value of the quoted currency. For example:

with the EURUSD the quoted currency is the Dollar. If the current price of the EURUSD is 1.3205 it means that 1 Euro is worth 1.3205 Dollars. If the price goes up to 1.3206, it has risen 1 pip, therefore the value of 1 pip relative to the Dollar is 0.0001

In this case the value of Point is 0.0001

It's mainly used to convert from integral pips to price values and back, for instance, if you want to hold a takeprofit value in an integer variable, you could do this:

int takeprofit = 40;

But if you add that to the buying price (Ask), you can't do it directly...

(Ask + takeprofit) would be the same as (1.3205 + 40) and would equal 41.3205 Not exactly what you want...

To make the math work, you have to convert 40 to 0.0040, which means you must multiply 40 * 0.0001. That's exactly what Point allows, without you have to worry about it.

(Ask + takeprofit * Point) = (1.3205 + 40 * 0.0001) = 1.3245 That's more like it!!

This is important when you want to create an EA that will work on any currency pair, since the pip value is not always the same. If you stored your takeprofit value as 0.0040, it would work for the EURUSD, but not for the USDJPY. By storing it as 40, you just multiply by Point, and it's correct no matter what currency pair you're using.

Happy (and profitable) coding!!

 

Thanks

Thanks for both responses. Very helpful when trying to acquaint yourself with the workings of code.

Greg

 

new features

When will experts folder be by itself and all sub folders recognised and compiled.

When will indicators folder be by itself and all sub folders recognised and compiled.

ie. so you could have many subfolders with a different version in each.

To save time in copy and tracking. ie. still happy to see no duplicate names of files in ALL sub folders but would be easier to create sensible storage and structure.

Also , saving a template is possible but you do not know what the last template name you last saved as.

Just my 2c.

 

Please

I would like to ask someone to tell me, where i made the mistake and what's wrong. Im learning to understande the codes and putting indic in done EAs to know how they work in. Now im trying to ''walk'' a super-signals indic in easy done EA but im getting 1 error and generaly is very hard indic for me, so please, if someone have time, lett me know what wrong and how to do it to be OK. Many thanks for answere.

J

Files:
s15min.mq4  4 kb
 
janka:
I would like to ask someone to tell me, where i made the mistake and what's wrong. Im learning to understande the codes and putting indic in done EAs to know how they work in. Now im trying to ''walk'' a super-signals indic in easy done EA but im getting 1 error and generaly is very hard indic for me, so please, if someone have time, lett me know what wrong and how to do it to be OK. Many thanks for answere. J

Hi, no one know it? It have to be very easy for thous know codes. No idea?

Please. J

 

Two session, one account

One question regarding using of MT4

Are some problem using two session in this way?

1 session on one PC with EA installed on some pairs

2 session open one other PC in the same time but w/o EA and used ONLY to open and close orders manually on the same account (not order related cross of EA running on the first PC)

These configuration could be used in case of an EA running 24/5 on PC at home and then you connect wirh your laptop from your office to check and make some discretional trading on other pairs, but on the same account.

The two platform seem to work ok, but some one knows some problem??

I know the investor login type, but in this case you can't make orders!

I someone can answer me thank you.

 
ottober8:
One question regarding using of MT4

Are some problem using two session in this way?

1 session on one PC with EA installed on some pairs

2 session open one other PC in the same time but w/o EA and used ONLY to open and close orders manually on the same account (not order related cross of EA running on the first PC)

These configuration could be used in case of an EA running 24/5 on PC at home and then you connect wirh your laptop from your office to check and make some discretional trading on other pairs, but on the same account.

The two platform seem to work ok, but some one knows some problem??

I know the investor login type, but in this case you can't make orders!

I someone can answer me thank you.

Hi ottober8,

I've never traded on the same account manually and by EA using the same PC/account but different metatraders.

I had one case when I opened one Metatrader 2 times (2 desktop connections) and EAs opened 2 orders on two same Metatraders.

We have this script to open the order manually with magic number https://www.mql5.com/en/forum/174881/page5 (if your EAs are having magic numbers so you may trade manually with different magic number).

 

Magic numbers

ND,

Thank you for the answer, but if orders of EA have a specific Magic number and manual don't, can the EA make mistake? If not specificated the Magic numer in manual trading is = 0?

Thanks