Requests & Ideas, the beginning - page 33

 

Locking indicators & experts to defined MT4 accounts

Hello,

Does anyone know how to lock indicators or expert advisors to specific

MT4 accounts?

Please attach a sample indicator with the code in the .mq4 file so it can be seen how it's done exactly.

Regards

 

I'm not a coder, but I've learned this much:

Look at the code of an MQ4 file.

The user variables that do appear are defined with "extern int".

The ones that are invisible are "int".

If you remove the "extern" from a variable they become inaccessable or "invisible" to the user unless the code is manipulated.

Once the file is compiled to ex4, it's completely locked.

 
odj66:
Hello,

Does anyone know how to lock indicators or expert advisors to specific

MT4 accounts?

Please attach a sample indicator with the code in the .mq4 file so it can be seen how it's done exactly.

Regards

For specific account or to other protection please read this thread https://www.mql5.com/en/forum/174194 and Codersguru article as well MQL4 programs protection! | www.metatrader.info

For an example you may see ema crossing EA from this post https://www.mql5.com/en/forum/173789

 

Profit Taking

Can someone that knows how to code give me a few bits of code that may work to take profit.

settings:

CloseLots: True

LotsToClose: .5 (how many lots will be closed)

CloseLotsAt: 20 (pips in positive, where EA will close lots)

also would be nice to pull remaining lots to break even.

settings:

PullToBE: True

PullToBEat: 30 (pips in positive, where EA will pull remaining lots to BE)

any help would be appreciated. Thanks.

MD

 

Look at the examples here https://www.mql5.com/en/forum/176044/page2 (may be MultiPositionExpert some version).

 
newdigital:
Look at the examples here https://www.mql5.com/en/forum/176044/page2 (may be MultiPositionExpert some version).

Thanks ND, I will look through them. I will see if I can find some code to cut and paste into existing EA.

 

Cubei-Method

Anyone knows EA based on Cubei-Method?

Is seems to be a spread maker for introducing broker...

The name of EA is TotalEACompound.ex4.

The EA works very well, but only in demo account.

As I have understood you is possible to have EA working on real account only if you subribe an account through a spcific IB

If some one has already good/ bad experience, please let me know

Thank you

 

Few months ago Igorad created EA using indicator created by Linuxser (see post #1 of this thread https://www.mql5.com/en/forum/general , item #50). EA is using indicator version #3.

It is not exact anti-martingale. But may be similar. EA is placing first order by 0.3 lot size for example, second - 0.2 and 3rd - 0.1. Just for example.

As pending orders (limit or stop orders).

So basicly it is the following:

- EA is placing sell limit or buy limit orders (trading inside pivot "channel");

or

- EA is placing buy stop or sell stop orders (trading on breakout of pivot lines).

That's fine but once per 2 months we are having big loss. Because price is going in opposite direction in some news event.

If it is possible to modify this EA to trade limit and stop orders simultaniously, or to use 5th_element EA logic so it may be fine.

People who tested this 5th_element EA know what i am talking about: if price is going to opposite direction by 20 or 40 pips so EA may open opposite order with 0.5 lot size for example and close all the orders in summarized profit.

If we combine those two EAs into one EA so it may be good. As EA is trading once per day in profit and we will have '5th_element case' just once per 2 month only. If someone can do it so may attach this EA.

It is not exact anti-martingale but very similar.

Files:
 

Money Management Function for ALL Brokers

I wanted to provide this function for handling money management. It will handle any broker (even Crown) and any account--mini, micro, standard. I think the programmers out there will find it to be helpful.

//+++++++++++++++++++++++++++++++++++++++++++++++++++++

double TradeLots(double percentRisk,int typeMM)

{

/*SPRTN (sprtn.com) Money management function for all brokers.*/

RefreshRates();

double lotSize=MarketInfo(Symbol(),MODE_LOTSIZE);

double totalLots=0.0;

if(typeMM==1) //Account Balance

{

double balance=AccountBalance();

totalLots=balance/lotSize*percentRisk;

}

if(typeMM==2) //Account Equity

{

double equity=AccountEquity();

totalLots=equity/lotSize*percentRisk;

}

if(typeMM==3) //Account Margin

{

double freeMargin=AccountFreeMargin();

double requiredMargin=MarketInfo(Symbol(),MODE_MARGINREQUIRED);

double marginDesired=percentRisk/100*freeMargin;

double marginFactor=marginDesired/requiredMargin;

totalLots=marginFactor;

}

double lotStep=MarketInfo(Symbol(),MODE_LOTSTEP);

totalLots=NormalizeDouble(totalLots/lotStep,0)*lotStep;

double maxLot=MarketInfo(Symbol(),MODE_MAXLOT);

double minLot=MarketInfo(Symbol(),MODE_MINLOT);

if(totalLots>maxLot)totalLots=maxLot;

if(totalLots<minLot)totalLots=minLot;

return (totalLots);

}

 

Ea

newdigital:
Few months ago Igorad created EA using indicator created by Linuxser (see post #1 of this thread https://www.mql5.com/en/forum/general , item #50). EA is using indicator version #3.

It is not exact anti-martingale. But may be similar. EA is placing first order by 0.3 lot size for example, second - 0.2 and 3rd - 0.1. Just for example.

As pending orders (limit or stop orders).

So basicly it is the following:

- EA is placing sell limit or buy limit orders (trading inside pivot "channel");

or

- EA is placing buy stop or sell stop orders (trading on breakout of pivot lines).

That's fine but once per 2 months we are having big loss. Because price is going in opposite direction in some news event.

If it is possible to modify this EA to trade limit and stop orders simultaniously, or to use 5th_element EA logic so it may be fine.

People who tested this 5th_element EA know what i am talking about: if price is going to opposite direction by 20 or 40 pips so EA may open opposite order with 0.5 lot size for example and close all the orders in summarized profit.

If we combine those two EAs into one EA so it may be good. As EA is trading once per day in profit and we will have '5th_element case' just once per 2 month only. If someone can do it so may attach this EA.

It is not exact anti-martingale but very similar.

ND,

Could you please post this EA? Thanks!

TK