EMA_WMA EA ECN mode

 

Hello dear friends,

I need some help, if I may ask. Last week I posted an EA : (EMA_WMA) that needed to be converted to work on 5 digit brokers. Mr. Unclepips did the job well, and he deserves to be thanked once more.

The problem is that the new version of the EA : (EMA_WMA V2) does not work properly. It does not open trades. Each time there is a moving average cross, a pop up window appears on the screen saying :

Error Invalid stops Ticket-1 EURUSD

Error Invalid stops Ticket-1 GBPUSD

Error Invalid stops Ticket-1 AUDUSD

................................................................

Any help to fix this problem is welcome...

Thanks for your time.

Files:
 
pajero:
Hello dear friends,

I need some help, if I may ask. Last week I posted an EA : (EMA_WMA) that needed to be converted to work on 5 digit brokers. Mr. Unclepips did the job well, and he deserves to be thanked once more.

The problem is that the new version of the EA : (EMA_WMA V2) does not work properly. It does not open trades. Each time there is a moving average cross, a pop up window appears on the screen saying :

Error Invalid stops Ticket-1 EURUSD

Error Invalid stops Ticket-1 GBPUSD

Error Invalid stops Ticket-1 AUDUSD

................................................................

Any help to fix this problem is welcome...

Thanks for your time.

My friend is skilled programmer, I'll ask him if he can help.

 

Thx

Thanks a lot Josef. I really appreciate...

 

I think that the ea is fixed properly. There may be a little differences between broker, and instruments. Check what you want to trade and what are your broker/instrument requirements. For example if you would like to trade DAX and you would like to put stop loss like 6681.1 or 6681.123 - because this would be value that was calculated by ea then you would get INVALID STOP because DAX requires levels to be rounded to 1 digit (like 6681.1) and the steps to be 0.5 so 6681.1 should be converted to 6681.0 or 6681.5.

I'm attaching the test that i made with your ea, on alpari, and it works fine (5 digits broker)

 

Hi Kalenzo,

The Expert works fine also on FXDD.... My account is with : (IBFX). The strategy tester works fine here... The problem is that the EA can't deal with lives quotes, it does not open trades at all, as I said in my first post. Please check it yourself. I can't understand why !!!! Thanks in advance...

 

Take a look on the picture. EA made eurusd trade without any problems.

But i think i know where is your problem. EA does not allow you to pick magic number for it's trades. So if you are trading more than 1 cross at a time it will put the same magic number for all orders. And after this it may try to close the order that was open at one cross with price from another. For example you trade EURUSD and USDJPY, at both currencies you have BUY SIGNAL (or sell signal it does not matter). At both of them trades were executed, and after this, ea got exit signal from USDJPY, and it tries to close EURUSD trades with USDJPY prices - then it generates error. Sending orders is not a problem with this ea - the problem is when you try to close them. Try to test it on one pair only. You will see that there is no problem. On my screenshot you can see that buy trade was executed, then it was closed and reversed to sell. ON ONE PAIR ONLY.

Files:
forward.png  88 kb
forward2.png  89 kb
 

I don't think this is the problem because on IBFX it does NOT open trades AT ALL. So the issue here is not about closing trades, or about magic numbers. One more thing : Why does this problem happen only witth IBFX ?? This EA (EMA_WMA V2) and even the original one (EMA_WMA) work pretty fine on FXDD, for example... Is there something wrong, or something very specific to IBFX MT4 ?? I have to admit that I m a bit confused. Kalenzo, please, try the EA on IBFX... Sorry for your time.... Thanks.

 

pajero

As far as I see on their account IBFX does not allow placing stop loss and/or take profit at the same time when you open an order (you can check it when you try to open an order manually : if the stop loss and take profit fields are grayed out when you are opening order manually then it behaves as ECN/STP brokers)

Here is a version that avoids that : set the EcnBrokerparameter to true and try it out. It should work OK

regards

Mladen

Files:
 

You are the man mladen. It works perfectly well now. I m so grateful.

With all my respect. Thanks....

 

2 ema entry 2 eam exit ea

first and foremost thank you in advance.

I need help writing an ea, but i dont know how. so if any coder will help me i apriciated, i will share my education and ea with every one in here.

ok to the fun stuff (EA info). It is a fairly simple ea. this is how i want it to work. place a buy or sell at the cross of 2 ema of the user choise and close the position at a the cross of two diffrent eam. please if possible incleduded in paremeter the option to set price, type, and shift. please set stoploss, breakeven, take profit, hours to oparate, lots, and make it ecn comparable. Please see the example below. i know nothing is free in this world so if i need to pay please pm to set cost.

Expert_Name = "---------- Universal MA Cross EA v8.1";

extern int MagicNumber = 1234;

extern double StopLoss = 1000,

TakeProfit = 200;

extern string TrailingStop_Setting = "---------- Trailing Stop Setting";

extern int TrailingStopType = 1,

TrailingStop = 40;

extern string BreakEven_Setting = "---------- Break Even Setting";

extern int UseBreakEven = 1, // 1=use, 0=ignore

BreakEven = 30;

extern string Indicator_Setting = "---------- Indicator Setting";

extern int FastMAPeriod = 3,

FastMAType = 1, //0:SMA 1:EMA 2:SMMA 3:LWMA

FastMAPrice = 0, //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted

FastMAshift = 0,

SlowMAPeriod = 20,

SlowMAType = 1, //0:SMA 1:EMA 2:SMMA 3:LWMA

SlowMAPrice = 0, //0:Close 1:Open 2:High 3:Low 4:Median 5:Typical 6:Weighted

SlowMAshift = 0;

 

Hi cway,

There are same Eas which I created long time ago using Gordago:

1. ma_expert EA: Enter on 2 ema crossing and exit on 2 ema crossing

2. MA_ExpertProfit EA: it is the same EA but it will close the orders in s/l or t/p only.

3. MA_ExpertProfit_all EA: it will close the order on s/l or t/p, or on the other crossing signal. This EA should work on particular account only. Just change the line "int Account = 111111;" to your account number inside the code. For example your account is 1235463. So this line should be like this:

int Account = 1235463.

4. MA_ExpertProfit_noacc.mq4: it is the same with item # 3. But it may work in any account (i mean account in Metatrader).

And EMA_6_12 EA is the EA coded by Codersguru.

Those EAs were coded long time ago so you can select any version and ask MrTools to improve/correct it for ecn options and 5 digit broker for example.

Reason: