0
(0)
نالو:
MA_Mirror EA
ليکڪ: tflores (2010.10.13 10:41)
ڊائون لوڊ ٿيل: 3050
ڊائون لوڊ ڪريو:
MA_Mirror EA 1
ea.mqh (9.0 Kb) ڏيک
MA_Mirror EA 1 ea_1_1.mqh (12.1 Kb) ڏيک
MA_Mirror EA 1 MA_MirrorEA.mq4 (2.7 Kb) ڏيک
Based on the indicator http://codebase.mql4.com/7061 (تمام گهڻي مهرباني) I wrote this simple Expert Advisor and it makes profit, at least in trend phases. Also in small time frames like M1 or M5.

The more complicated functions are in the include file ea.mhq and serve for all my expert advisors. The start() functions checks the order, calls the function which does trailing stop loss and such then calls the function Signal() to find out if the indicator part of the EA wants something to have done, it than acts acording to the Signal. سگنل() returns -1 or OP_BUY/OP_SELL if it wants to sell or buy.

int Signal()
{

int i=1;
int signal = -1;
double ma1, ma2;
ma1=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,i)-وٽ(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_OPEN,i);
ma2=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_OPEN,i)-وٽ(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,i);

جيڪڏهن (ma1 > ma2) signal = OP_BUY;
جيڪڏهن (ma1 < ma2) signal = OP_SELL;

واپسي (سگنل);

}

 

You can simple modify the Signal() to do what you want, for example a different indicator, always buy or sell or even use a random number gernerator (I use all of them in order to see if the expert is better than simply buying or selling (in a trend) or random).

 

MA_Mirror EA 4

MA_Mirror EA 5

 

 

------------------------------------------------------------

 

Updated version of ea.mqh, please rename to ea.mqh

 

There was an error in FindOrders (I accidently removed a line)
New feature: BreakEven, if indicator is 20 pips in plus, it sets stop loss to be 0

 

8 تبصرا ھڪڙو نئون تبصرو پوسٽ ڪرڻ لاء, مهرباني ڪري لاگ ان يا رجسٽر

Thanks for EA, this EA did not start. the error is "Cannot open file: ج:\meta\ SIGTrader\experts\MA_MirrorEA.ex4 on the GBPUSDX,M1". Please specify instructions on how to go about your EA.
02.12.2011 07:26 gspin

Thankyou very much.

I put the ea file in experts folder and try to run the ea on chart but it is not working. Please suggest me if anything to do with above two files as well.

 

حوالي

Mayank

22.11.2010 13:39 mayanksaini11

I think it also makes the moving average react faster - at least it is more successful than using a single ma.
29.10.2010 01:38 tflores

There are some brokers which do not allow setting the stop loss at the same time as opening the order.

The EA has more functions than nessary, this is because I develop ea.mqh separatly from the experts, so each expert profits from a new version of ea.mqh.

29.10.2010 01:17 tflores

I don't think the signal function is doing much, just gets the difference of CLOSE & OPEN prices, we only need one variable MA, no need of ma1 & ma2, ma2 is opposite of ma1

int Signal()
{

int i=1;
int signal = -1;

double ma;

ma=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,i)-وٽ(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_OPEN,i);

جيڪڏهن (ma > 0) signal = OP_BUY;
جيڪڏهن (ma < 0) signal = OP_SELL;

واپسي (سگنل);

 

18.10.2010 12:30 samuelkngugi

I have the same error, "Invalid stops, Order Send error 130", and I have tried many different lot sizes with no difference.

Have you got a hint on why your stoploss or stops are failing!

I also noticed that "EA.mqh and MA_MirrorEA.mq4" when compiled, show all errors about missing links to functions.

مهرباني

Roger

16.10.2010 08:31 Micky52

kwng:
I have tried your EA and have an error message: MA_MirrorEA EURUSD,M1: Error invalid trade volume, an EA was not working, may I know what's wrong with it. مهرباني.

This is the lot size, default ist 0,01 but this small is not allowed by all brokers.

14.10.2010 14:24 tflores

I have tried your EA and have an error message: MA_MirrorEA EURUSD,M1: Error invalid trade volume, an EA was not working, may I know what's wrong with it. مهرباني.

هي پوسٽ ڪيترو مفيد هو?

ان کي ريٽ ڪرڻ لاء اسٽار تي ڪلڪ ڪريو!

سراسري درجه بندي 0 / 5. ووٽن جي ڳڻپ: 0

هن وقت تائين ڪوبه ووٽ ناهي! هن پوسٽ جي درجه بندي ڪرڻ لاء پهريون ٿيو.

اسان کي افسوس آهي ته هي پوسٽ توهان لاء مفيد نه هئي!

اچو ته هن پوسٽ کي بهتر بڻايون!

اسان کي ٻڌايو ته اسان هن پوسٽ کي ڪيئن بهتر ڪري سگهون ٿا?



ليکڪ: فاریکس وڪي ٽيم
اسان انتهائي تجربيڪار فاریکس واپارين جي ٽيم آهيون [2000-2023] جيڪي اسان جي پنهنجي شرطن تي زندگي گذارڻ لاءِ وقف آهن. اسان جو بنيادي مقصد مالي آزادي ۽ آزادي حاصل ڪرڻ آهي, ۽ اسان خود تعليم حاصل ڪئي آهي ۽ فاریکس مارڪيٽ ۾ وسيع تجربو حاصل ڪيو آهي جيئن اسان جو مطلب هڪ خودمختاري واري زندگي گذارڻ جي لاءِ آهي..