- Accueil
- Communauté
- Programmation
- I will program your PROFITABLE trading system into an EA for...
Advertisement
Edit Your Comment
I will program your PROFITABLE trading system into an EA for free!
Mar 13, 2013 at 11:34
(édité Mar 13, 2013 at 11:23)
Membre depuis Sep 12, 2012
posts 10
Firstly let me say I'm a Computer Developer with over 30 years of experience on a variety of hardware platforms.
I've been trading Forex for nearly a decade now and programming my own personal EAs and indicators (some exceptionally complex!).
For a very limited number of people I am prepared to code their existing personal manual trading system into an automated EA for free. There are few conditions though:
1. You must demonstrate to me in advance to my satisfaction that your system is profitable (ideally through an myfxbook link although other proof will be considered/required) .
2. The final EA is not to be sold commercially, only used privately
3. After successful development I have permission to use the EA on my own personal accounts (I will never release it to anyone else)
4. You must provide the detail, the "precise rules" of exactly how the system works so that I can code it.
Hopefully you can see the above is a win-win for both parties, matching my programming skills with trading expertise.
Please feel free to post any questions here on the open thread or alternatively contact me viai private message.
I've been trading Forex for nearly a decade now and programming my own personal EAs and indicators (some exceptionally complex!).
For a very limited number of people I am prepared to code their existing personal manual trading system into an automated EA for free. There are few conditions though:
1. You must demonstrate to me in advance to my satisfaction that your system is profitable (ideally through an myfxbook link although other proof will be considered/required) .
2. The final EA is not to be sold commercially, only used privately
3. After successful development I have permission to use the EA on my own personal accounts (I will never release it to anyone else)
4. You must provide the detail, the "precise rules" of exactly how the system works so that I can code it.
Hopefully you can see the above is a win-win for both parties, matching my programming skills with trading expertise.
Please feel free to post any questions here on the open thread or alternatively contact me viai private message.
Freefox
Membre depuis Mar 14, 2013
posts 2
Mar 15, 2013 at 09:21
Membre depuis Mar 14, 2013
posts 2
Hi. I was looking for someone with your exact preference, that is, my plan, your programming, no sharing with anyone else. I don't know if you'll program this for me. It IS a proven system, and VERY profitable, but, I have only traded on demo accounts for the one year I've been involved with Forex. So, although I can not show you Real money, yet, I can show you what I know, and if I'm correct, this SIMPLE EA could make as much as 5000%+ in 20 Weeks!!!! And of this, I have proof.
I have not persue'd programming this EA yet because I've been chasing dumb robots and binary options for months. Soon, I will have time to go back and nail this EA down. I'm offering this info to you today because it will be quicker for me to outsource the programming. And time is Money.
Needles to say, if you are not willing to program this for me, I will eventually program it by myself. I have a technical background, electronics and computers and it's only a matter of time until I find the time to use an assembler or learn the MT4 language. But this is a good chance for YOU to make a lot of money and the door is open.
If you're interested in seeing what I can show you, let me know. If you decide not to program the EA for me, that's fine too, I only ask that for sharing my knowledge, if you ever changed your mind down the road and DO program the EA, that you send me a copy then.
Contact me directly , and put something in the Subject Line about Programmer from FX book, I get a lot of spam and I wouldn't want to miss your e-mail.
Thanks....
Nick F. in NY USA
I have not persue'd programming this EA yet because I've been chasing dumb robots and binary options for months. Soon, I will have time to go back and nail this EA down. I'm offering this info to you today because it will be quicker for me to outsource the programming. And time is Money.
Needles to say, if you are not willing to program this for me, I will eventually program it by myself. I have a technical background, electronics and computers and it's only a matter of time until I find the time to use an assembler or learn the MT4 language. But this is a good chance for YOU to make a lot of money and the door is open.
If you're interested in seeing what I can show you, let me know. If you decide not to program the EA for me, that's fine too, I only ask that for sharing my knowledge, if you ever changed your mind down the road and DO program the EA, that you send me a copy then.
Contact me directly , and put something in the Subject Line about Programmer from FX book, I get a lot of spam and I wouldn't want to miss your e-mail.
Thanks....
Nick F. in NY USA
Membre depuis Aug 26, 2011
posts 2
Apr 03, 2013 at 18:41
Membre depuis Aug 26, 2011
posts 2
Hi FreeFox,
I have one strategy for which it needs to create two separate EA..
EA will have 2/3 components including increament of trading volume based on last closing trades...
I am afraid of secrecy matter...
I hope u will assure me about the issue..
Thanks
I have one strategy for which it needs to create two separate EA..
EA will have 2/3 components including increament of trading volume based on last closing trades...
I am afraid of secrecy matter...
I hope u will assure me about the issue..
Thanks
Apr 04, 2013 at 11:26
Membre depuis Sep 12, 2012
posts 10
Hi Razz,
You can rest assured about privacy/secrecy ... any discussions and material will always be between just us two. Reputation and integrity is very important to me.
If you want to drop me a private message to discuss things further please use the private mail facility on myfxbook initially and maybe we could then swap email addresses.
Best regards
You can rest assured about privacy/secrecy ... any discussions and material will always be between just us two. Reputation and integrity is very important to me.
If you want to drop me a private message to discuss things further please use the private mail facility on myfxbook initially and maybe we could then swap email addresses.
Best regards
Freefox
Apr 13, 2013 at 21:11
Membre depuis Sep 12, 2012
posts 10
Just quickly like to clarify my offer for me to to program your trading system for free into an EA.
It's open to everyone but please see the few requirements listed in my opening post. In fact for simplicity I'll copy it here again:
It is important that point 1 is met above as I am getting a lot of requests from people that are basically just ideas for systems rather than provable profitable ones. They may work, they may not but sorry I'm only interested in those with some form of proof that they are profitable.
So anyone got a great profitable system that they are trading and would like it converting into an EA I'm happy to do it. Win-win for both of us :-)
It's open to everyone but please see the few requirements listed in my opening post. In fact for simplicity I'll copy it here again:
Freefox posted:
Firstly let me say I'm a Computer Developer with over 30 years of experience on a variety of hardware platforms.
I've been trading Forex for nearly a decade now and programming my own personal EAs and indicators (some exceptionally complex!).
For a very limited number of people I am prepared to code their existing personal manual trading system into an automated EA for free. There are few conditions though:
1. You must demonstrate to me in advance to my satisfaction that your system is profitable (ideally through an myfxbook link although other proof will be considered/required) .
2. The final EA is not to be sold commercially, only used privately
3. After successful development I have permission to use the EA on my own personal accounts (I will never release it to anyone else)
4. You must provide the detail, the "precise rules" of exactly how the system works so that I can code it.
Hopefully you can see the above is a win-win for both parties, matching my programming skills with trading expertise.
Please feel free to post any questions here on the open thread or alternatively contact me via private message.
It is important that point 1 is met above as I am getting a lot of requests from people that are basically just ideas for systems rather than provable profitable ones. They may work, they may not but sorry I'm only interested in those with some form of proof that they are profitable.
So anyone got a great profitable system that they are trading and would like it converting into an EA I'm happy to do it. Win-win for both of us :-)
Freefox
Apr 15, 2013 at 06:25
Membre depuis Mar 01, 2013
posts 69
I have a different approach. If you present to me the rules of your strategy and it sound interesting to me; I will code it up for you for free. So long as I can used the strategy privately, you can use the source and ex4 anyway you like.
You win some, you lose some.

forex_trader_9219
Membre depuis Mar 24, 2010
posts 3
Apr 15, 2013 at 07:52
Membre depuis Mar 24, 2010
posts 3
Hello Freefox,
can you sent me your emailadress per PM? I have an interesting strategy that i personally trade.
I have started a new demo at the beginning of this month:
https://www.myfxbook.com/members/mondalsys/spt-system-2013/538506
If you are interested please contact me.
Thanks
mondalsys
can you sent me your emailadress per PM? I have an interesting strategy that i personally trade.
I have started a new demo at the beginning of this month:
https://www.myfxbook.com/members/mondalsys/spt-system-2013/538506
If you are interested please contact me.
Thanks
mondalsys
Membre depuis Feb 19, 2014
posts 1
Feb 19, 2014 at 21:57
Membre depuis Feb 19, 2014
posts 1
I Have a wery good momentum pa strategy i managed to make up its rather new for me if you are intressted and have time over send a Pm .
But iam not sure how advanced a Ea can be made.
Security ofcourse of highest priority only between programer and me .
Take care and bless.
But iam not sure how advanced a Ea can be made.
Security ofcourse of highest priority only between programer and me .
Take care and bless.
Membre depuis Nov 22, 2013
posts 1
Apr 08, 2014 at 07:02
Membre depuis Nov 22, 2013
posts 1
Can you please make a simple modification to an EA ?
-------------------------------------------------------------------------
Hello.
Can you please make a small modification to the EA below ?
Can you please make, that instead of opening a BUY Trade, it will open a SELL Trade, and instead of opening a SELL Trade, it will open a BUY Trade ?
Another problem with this EA: Sometimes it doesn't trade at all for hours or more.
can you tell me why, and how to correct this problem ?
Thank you.
//----------------------- INCLUDES
#include
//----------------------- EA PARAMETER
extern string
Expert_Name = "---------- Price Cross MA v0.3";
extern double
StopLoss = 30,
TakeProfit = 25,
TrailingStop = 25;
extern string
MA_Setting = "---------- Moving Average Setting";
extern int
MAPeriod = 30,
MAMethod = 0, //0:SMA 1:EMA 2:SMMA 3:LWMA
MAPrice = 0; //0:CLOSE 1:OPEN
extern string
Order_Setting = "---------- Order Setting";
extern int
NumberOfTries = 5,
Slippage = 5;
extern bool
StopAndReverse = true; // if signal change, exit and reverse order
extern string
Time_Parameters = "---------- EA Active Time";
extern bool
UseHourTrade = false;
extern int
StartHour = 10,
EndHour = 11;
extern string
MM_Parameters = "---------- MoneyManagement by L.Williams";
extern double
Lots = 1;
extern bool
MM = true, //Use Money Management or not
AccountIsMicro = false; //Use Micro-Account or not
extern int
Risk = 10; //10%
extern bool
Show_Settings = true;
//----------------------- GLOBAL VARIABLE
static int
TimeFrame = 0;
string
TicketComment = "PriceCrossMA v0.3";
int
MagicNumber = 20060410;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVENT RE-COUNTING WHILE USER CHANGING TIME FRAME
//----------------------- SOURCE : CODERSGURU
TimeFrame=Period();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
double
OpenPricePrevious,
ClosePricePrevious,
OpenPriceCurrent,
MAValuePrevious,
MAValueCurrent;
int
cnt,
ticket,
total;
//----------------------- TIME FILTER
if (UseHourTrade)
{
if(!(Hour()>=StartHour && Hour()<=EndHour))
{
Comment("Non-Trading Hours!");
return(0);
}
}
//----------------------- CHECK CHART NEED MORE THAN 100 BARS
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
//----------------------- ADJUST LOTS IF USING MONEY MANAGEMENT
if(MM==true) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL ORDER BASE ON MAGICNUMBER AND SYMBOL
total = subTotalTrade();
//----------------------- SET VALUE FOR VARIABLE
OpenPricePrevious = iOpen (NULL,TimeFrame,1);
ClosePricePrevious = iClose(NULL,TimeFrame,1);
OpenPriceCurrent = iOpen (NULL,TimeFrame,0);
MAValuePrevious = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,1);
MAValueCurrent = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,0);
//----------------------- IF NO TRADE
if(total < 1)
{
//----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,"BUY");
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent 0 ||
StopAndReverse)
{
for(cnt=0;cntMAValuePrevious &&
OpenPriceCurrent 0) // trailing stop
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()MAValueCurrent)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet); // close sell order
ticket = subOpenOrder(OP_BUY); // open buy order
subCheckError(ticket,"BUY");
return(0);
}
}
if(TrailingStop>0) // trailing stop
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
return(0);
}
//----------------------- END PROGRAM
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS
//+------------------------------------------------------------------+
//----------------------- MONEY MANAGEMENT FUNCTION
//----------------------- SOURCE : CODERSGURU
double subLotSize()
{
double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;
if(AccountIsMicro==false) //normal account
{
if (lotMM < 0.1) lotMM = Lots;
if ((lotMM > 0.5) && (lotMM < 1)) lotMM=0.5;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
else //micro account
{
if (lotMM < 0.01) lotMM = Lots;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
return (lotMM);
}
//----------------------- NUMBER OF ORDER BASE ON SYMBOL AND MAGICNUMBER FUNCTION
int subTotalTrade()
{
int
cnt,
total;
for(cnt=0;cnt0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print(Type + " order opened : ",OrderOpenPrice());
}
else Print("Error opening " + Type + " order : ", ErrorDescription(GetLastError()));
}
//----------------------- END FUNCTION
-------------------------------------------------------------------------
Hello.
Can you please make a small modification to the EA below ?
Can you please make, that instead of opening a BUY Trade, it will open a SELL Trade, and instead of opening a SELL Trade, it will open a BUY Trade ?
Another problem with this EA: Sometimes it doesn't trade at all for hours or more.
can you tell me why, and how to correct this problem ?
Thank you.
//----------------------- INCLUDES
#include
//----------------------- EA PARAMETER
extern string
Expert_Name = "---------- Price Cross MA v0.3";
extern double
StopLoss = 30,
TakeProfit = 25,
TrailingStop = 25;
extern string
MA_Setting = "---------- Moving Average Setting";
extern int
MAPeriod = 30,
MAMethod = 0, //0:SMA 1:EMA 2:SMMA 3:LWMA
MAPrice = 0; //0:CLOSE 1:OPEN
extern string
Order_Setting = "---------- Order Setting";
extern int
NumberOfTries = 5,
Slippage = 5;
extern bool
StopAndReverse = true; // if signal change, exit and reverse order
extern string
Time_Parameters = "---------- EA Active Time";
extern bool
UseHourTrade = false;
extern int
StartHour = 10,
EndHour = 11;
extern string
MM_Parameters = "---------- MoneyManagement by L.Williams";
extern double
Lots = 1;
extern bool
MM = true, //Use Money Management or not
AccountIsMicro = false; //Use Micro-Account or not
extern int
Risk = 10; //10%
extern bool
Show_Settings = true;
//----------------------- GLOBAL VARIABLE
static int
TimeFrame = 0;
string
TicketComment = "PriceCrossMA v0.3";
int
MagicNumber = 20060410;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVENT RE-COUNTING WHILE USER CHANGING TIME FRAME
//----------------------- SOURCE : CODERSGURU
TimeFrame=Period();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
double
OpenPricePrevious,
ClosePricePrevious,
OpenPriceCurrent,
MAValuePrevious,
MAValueCurrent;
int
cnt,
ticket,
total;
//----------------------- TIME FILTER
if (UseHourTrade)
{
if(!(Hour()>=StartHour && Hour()<=EndHour))
{
Comment("Non-Trading Hours!");
return(0);
}
}
//----------------------- CHECK CHART NEED MORE THAN 100 BARS
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
//----------------------- ADJUST LOTS IF USING MONEY MANAGEMENT
if(MM==true) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL ORDER BASE ON MAGICNUMBER AND SYMBOL
total = subTotalTrade();
//----------------------- SET VALUE FOR VARIABLE
OpenPricePrevious = iOpen (NULL,TimeFrame,1);
ClosePricePrevious = iClose(NULL,TimeFrame,1);
OpenPriceCurrent = iOpen (NULL,TimeFrame,0);
MAValuePrevious = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,1);
MAValueCurrent = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,0);
//----------------------- IF NO TRADE
if(total < 1)
{
//----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,"BUY");
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent 0 ||
StopAndReverse)
{
for(cnt=0;cntMAValuePrevious &&
OpenPriceCurrent 0) // trailing stop
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()MAValueCurrent)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet); // close sell order
ticket = subOpenOrder(OP_BUY); // open buy order
subCheckError(ticket,"BUY");
return(0);
}
}
if(TrailingStop>0) // trailing stop
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
return(0);
}
//----------------------- END PROGRAM
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS
//+------------------------------------------------------------------+
//----------------------- MONEY MANAGEMENT FUNCTION
//----------------------- SOURCE : CODERSGURU
double subLotSize()
{
double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;
if(AccountIsMicro==false) //normal account
{
if (lotMM < 0.1) lotMM = Lots;
if ((lotMM > 0.5) && (lotMM < 1)) lotMM=0.5;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
else //micro account
{
if (lotMM < 0.01) lotMM = Lots;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
return (lotMM);
}
//----------------------- NUMBER OF ORDER BASE ON SYMBOL AND MAGICNUMBER FUNCTION
int subTotalTrade()
{
int
cnt,
total;
for(cnt=0;cnt0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print(Type + " order opened : ",OrderOpenPrice());
}
else Print("Error opening " + Type + " order : ", ErrorDescription(GetLastError()));
}
//----------------------- END FUNCTION
Membre depuis Aug 08, 2013
posts 3
Apr 08, 2014 at 15:17
Membre depuis Aug 08, 2013
posts 3
Simply change "OP_BUY" with "OP_SELL" and "OP_SELL" with "OP_BUY" in the code as seen below..
----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,'BUY');
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent
//----------------------- EA PARAMETER
extern string
Expert_Name = "---------- Price Cross MA v0.3";
extern double
StopLoss = 30,
TakeProfit = 25,
TrailingStop = 25;
extern string
MA_Setting = "---------- Moving Average Setting";
extern int
MAPeriod = 30,
MAMethod = 0, //0:SMA 1:EMA 2:SMMA 3:LWMA
MAPrice = 0; //0:CLOSE 1:OPEN
extern string
Order_Setting = "---------- Order Setting";
extern int
NumberOfTries = 5,
Slippage = 5;
extern bool
StopAndReverse = true; // if signal change, exit and reverse order
extern string
Time_Parameters = "---------- EA Active Time";
extern bool
UseHourTrade = false;
extern int
StartHour = 10,
EndHour = 11;
extern string
MM_Parameters = "---------- MoneyManagement by L.Williams";
extern double
Lots = 1;
extern bool
MM = true, //Use Money Management or not
AccountIsMicro = false; //Use Micro-Account or not
extern int
Risk = 10; //10%
extern bool
Show_Settings = true;
//----------------------- GLOBAL VARIABLE
static int
TimeFrame = 0;
string
TicketComment = "PriceCrossMA v0.3";
int
MagicNumber = 20060410;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVENT RE-COUNTING WHILE USER CHANGING TIME FRAME
//----------------------- SOURCE : CODERSGURU
TimeFrame=Period();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
double
OpenPricePrevious,
ClosePricePrevious,
OpenPriceCurrent,
MAValuePrevious,
MAValueCurrent;
int
cnt,
ticket,
total;
//----------------------- TIME FILTER
if (UseHourTrade)
{
if(!(Hour()>=StartHour && Hour()<=EndHour))
{
Comment("Non-Trading Hours!");
return(0);
}
}
//----------------------- CHECK CHART NEED MORE THAN 100 BARS
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
//----------------------- ADJUST LOTS IF USING MONEY MANAGEMENT
if(MM==true) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL ORDER BASE ON MAGICNUMBER AND SYMBOL
total = subTotalTrade();
//----------------------- SET VALUE FOR VARIABLE
OpenPricePrevious = iOpen (NULL,TimeFrame,1);
ClosePricePrevious = iClose(NULL,TimeFrame,1);
OpenPriceCurrent = iOpen (NULL,TimeFrame,0);
MAValuePrevious = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,1);
MAValueCurrent = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,0);
//----------------------- IF NO TRADE
if(total < 1)
{
//----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,"BUY");
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent 0 ||
StopAndReverse)
{
for(cnt=0;cntMAValuePrevious &&
OpenPriceCurrent 0) // trailing stop
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()MAValueCurrent)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet); // close sell order
ticket = subOpenOrder(OP_BUY); // open buy order
subCheckError(ticket,"BUY");
return(0);
}
}
if(TrailingStop>0) // trailing stop
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
return(0);
}
//----------------------- END PROGRAM
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS
//+------------------------------------------------------------------+
//----------------------- MONEY MANAGEMENT FUNCTION
//----------------------- SOURCE : CODERSGURU
double subLotSize()
{
double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;
if(AccountIsMicro==false) //normal account
{
if (lotMM < 0.1) lotMM = Lots;
if ((lotMM > 0.5) && (lotMM < 1)) lotMM=0.5;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
else //micro account
{
if (lotMM < 0.01) lotMM = Lots;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
return (lotMM);
}
//----------------------- NUMBER OF ORDER BASE ON SYMBOL AND MAGICNUMBER FUNCTION
int subTotalTrade()
{
int
cnt,
total;
for(cnt=0;cnt0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print(Type + " order opened : ",OrderOpenPrice());
}
else Print("Error opening " + Type + " order : ", ErrorDescription(GetLastError()));
}
//----------------------- END FUNCTION
----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,'BUY');
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent
//----------------------- EA PARAMETER
extern string
Expert_Name = "---------- Price Cross MA v0.3";
extern double
StopLoss = 30,
TakeProfit = 25,
TrailingStop = 25;
extern string
MA_Setting = "---------- Moving Average Setting";
extern int
MAPeriod = 30,
MAMethod = 0, //0:SMA 1:EMA 2:SMMA 3:LWMA
MAPrice = 0; //0:CLOSE 1:OPEN
extern string
Order_Setting = "---------- Order Setting";
extern int
NumberOfTries = 5,
Slippage = 5;
extern bool
StopAndReverse = true; // if signal change, exit and reverse order
extern string
Time_Parameters = "---------- EA Active Time";
extern bool
UseHourTrade = false;
extern int
StartHour = 10,
EndHour = 11;
extern string
MM_Parameters = "---------- MoneyManagement by L.Williams";
extern double
Lots = 1;
extern bool
MM = true, //Use Money Management or not
AccountIsMicro = false; //Use Micro-Account or not
extern int
Risk = 10; //10%
extern bool
Show_Settings = true;
//----------------------- GLOBAL VARIABLE
static int
TimeFrame = 0;
string
TicketComment = "PriceCrossMA v0.3";
int
MagicNumber = 20060410;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----------------------- PREVENT RE-COUNTING WHILE USER CHANGING TIME FRAME
//----------------------- SOURCE : CODERSGURU
TimeFrame=Period();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
double
OpenPricePrevious,
ClosePricePrevious,
OpenPriceCurrent,
MAValuePrevious,
MAValueCurrent;
int
cnt,
ticket,
total;
//----------------------- TIME FILTER
if (UseHourTrade)
{
if(!(Hour()>=StartHour && Hour()<=EndHour))
{
Comment("Non-Trading Hours!");
return(0);
}
}
//----------------------- CHECK CHART NEED MORE THAN 100 BARS
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
//----------------------- ADJUST LOTS IF USING MONEY MANAGEMENT
if(MM==true) Lots = subLotSize();
//----------------------- ENTRY
//----------------------- TOTAL ORDER BASE ON MAGICNUMBER AND SYMBOL
total = subTotalTrade();
//----------------------- SET VALUE FOR VARIABLE
OpenPricePrevious = iOpen (NULL,TimeFrame,1);
ClosePricePrevious = iClose(NULL,TimeFrame,1);
OpenPriceCurrent = iOpen (NULL,TimeFrame,0);
MAValuePrevious = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,1);
MAValueCurrent = iMA (NULL,TimeFrame,MAPeriod,0,MAMethod,MAPrice,0);
//----------------------- IF NO TRADE
if(total < 1)
{
//----------------------- BUY CONDITION
if(OpenPricePreviousMAValueCurrent)
{
ticket = subOpenOrder(OP_BUY); // open BUY order
subCheckError(ticket,"BUY");
return(0);
}
//----------------------- SELL CONDITION
if(OpenPricePrevious>MAValuePrevious &&
OpenPriceCurrent 0 ||
StopAndReverse)
{
for(cnt=0;cntMAValuePrevious &&
OpenPriceCurrent 0) // trailing stop
{
if(Bid-OrderOpenPrice()>Point*TrailingStop &&
OrderStopLoss()MAValueCurrent)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Violet); // close sell order
ticket = subOpenOrder(OP_BUY); // open buy order
subCheckError(ticket,"BUY");
return(0);
}
}
if(TrailingStop>0) // trailing stop
{
if(OrderOpenPrice()-Ask>Point*TrailingStop)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
return(0);
}
//----------------------- END PROGRAM
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS
//+------------------------------------------------------------------+
//----------------------- MONEY MANAGEMENT FUNCTION
//----------------------- SOURCE : CODERSGURU
double subLotSize()
{
double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;
if(AccountIsMicro==false) //normal account
{
if (lotMM < 0.1) lotMM = Lots;
if ((lotMM > 0.5) && (lotMM < 1)) lotMM=0.5;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
else //micro account
{
if (lotMM < 0.01) lotMM = Lots;
if (lotMM > 1.0) lotMM = MathCeil(lotMM);
if (lotMM > 100) lotMM = 100;
}
return (lotMM);
}
//----------------------- NUMBER OF ORDER BASE ON SYMBOL AND MAGICNUMBER FUNCTION
int subTotalTrade()
{
int
cnt,
total;
for(cnt=0;cnt0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print(Type + " order opened : ",OrderOpenPrice());
}
else Print("Error opening " + Type + " order : ", ErrorDescription(GetLastError()));
}
//----------------------- END FUNCTION
Membre depuis Apr 14, 2014
posts 3

*Lutilisation commerciale et le spam ne seront pas tolérés et peuvent entraîner la fermeture du compte.
Conseil : Poster une image/une url YouTube sera automatiquement intégrée dans votre message!
Conseil : Tapez le signe @ pour compléter automatiquement un nom dutilisateur participant à cette discussion.