Ask! - page 93

 

Symbol Pips

Hello, can anyone guide me on how to calculate single symbol pips.

Example, i've 2 chart GBPJPY and GBPUSD, so i want to count GBPJPY and GBPUSD pips separately. Please help.

TQ.

 

How to make indicator or EA valid for only one person?

I am still figuring out, how to make indicator or EA which only 1 user can use.

What string code should be added in .mtq?

For example,

I want to give indicator or EA to codersguru, so that anyone other than codersguru who copy it and put it on their own computer won't able to use that indicator or EA.

Thanks a lot in advance before.

 
codersguru:
if(DayOfWeek()==5 && TimeHour(TimeCurrent())==8) return(0);
put this line into the start() function and before any line fo code!

I have tried all the possibility posted in this thread,

I think this code is the best one for shutting down EA and Indicator at certain time

simple yet powerful

Thanks a lot codersguru

 

Account code

ANCOLL:
I am still figuring out, how to make indicator or EA which only 1 user can use.

What string code should be added in .mtq?

For example,

I want to give indicator or EA to codersguru, so that anyone other than codersguru who copy it and put it on their own computer won't able to use that indicator or EA.

Thanks a lot in advance before.

This works by allowing the indicator or EA to work only on 1 account, sample of code in mq4 posted below, this works but there may be a better way to do it ???

int Account = 12345;

if (Account != AccountNumber()){

Comment("Incorrect account : "+AccountNumber()+" Price Display Indicator Deactivated !");

return(0);

}else {Comment(" Price Display Indicator Activated");}

price_display_1.mq4

Files:
 

Client - Server Authentication!

If we assumed that the EX4 will not be decompiled then the best way is Client - Server Authentication!

Where the MetaTrader connects to a DLL

the DLL connects to a Server (web server build in PHP)

the Server connects to a database to check the user data (account number - reg number - trial period etc)

This is the perfect method providing the cracker will not crack the EX4 and know the idea of the indicator or the expert advisor!

cja:
This works by allowing the indicator or EA to work only on 1 account, sample of code in mq4 posted below, this works but there may be a better way to do it ???

int Account = 12345;

if (Account != AccountNumber()){

Comment("Incorrect account : "+AccountNumber()+" Price Display Indicator Deactivated !");

return(0);

}else {Comment(" Price Display Indicator Activated");}

price_display_1.mq4
 

Help with coding

Can anyone help me with this code:

void CloseOrder(int minutes)

{

int total = OrdersTotal();

for (int cnt = 0 ; cnt < total ; cnt++)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if ((CurTime()-OrderOpenTime())>minutes*60)

{

if(OrderType()==OP_BUY)

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Violet);

if(OrderType()==OP_SELL)

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet);

}

}

}

This is code that I am trying to incorporate into an EA but am having problems when compiling. I get this error: Function "CloseOrder" is not referenced and will be removed from exp-file

This code was posted by codersguru from this post:

https://www.mql5.com/en/forum/general

What I am trying to do is to develop a system that will close all trades after x amount of time since opening of the most recent trade.

I have very little knowledge in coding but am trying to learn.

If this type of problem has been addressed before then could someone please point me to the proper thread as I have not been able to find one on this forum using the search function. Thank you.

 
RaidenDSI:
Can anyone help me with this code:

void CloseOrder(int minutes)

{

int total = OrdersTotal();

for (int cnt = 0 ; cnt < total ; cnt++)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if ((CurTime()-OrderOpenTime())>minutes*60)

{

if(OrderType()==OP_BUY)

OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Violet);

if(OrderType()==OP_SELL)

OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet);

}

}

}

This is code that I am trying to incorporate into an EA but am having problems when compiling. I get this error: Function "CloseOrder" is not referenced and will be removed from exp-file

This code was posted by codersguru from this post:

https://www.mql5.com/en/forum/general

What I am trying to do is to develop a system that will close all trades after x amount of time since opening of the most recent trade.

I have very little knowledge in coding but am trying to learn.

If this type of problem has been addressed before then could someone please point me to the proper thread as I have not been able to find one on this forum using the search function. Thank you.

It's easy: the code above is a function, so you need to call it somewhere. If you never call it, this function will never run, so it's useless to keep it in the compiled file; that's the meaning of the error you get.

 

Drop Down Menu For Inputs

Is there a way to code a dropdown menu for indicator inputs?

For example, if the input was myPeriod, I would like to have:

PERIOD_M1

PERIOD_M5

.

.

.

PERIOD_W1

PERIOD_MN1

appear.

Thanks.

 

can u tell me....

i'm using an ea, and i always received the error on the meta journal like this:

12:11:32 Old tick USDJPY30 110.77000/110.80000

12:11:32 Old tick USDJPY240 110.77000/110.80000

12:41:07 Old tick EURUSD30 1.46730/1.46760

12:41:07 Old tick EURUSD240 1.46730/1.46760

13:40:33 Old tick USDJPY30 110.90000/110.93000

13:40:33 Old tick USDJPY240 110.90000/110.93000

i already reinstall the metatrader,and still got the error

what can i do to solve this problem ?

 

I wonder..

I wonder if there's a way to remove the banner, coz it sometimes block view from other indicator.

Too bad, it's .ex4

The indicator, I attached below

Files:
Reason: