So I have been trading for a few years now and finally decided to give a shot at developing my own EA. I have taken some lessons post around various forums and have done some VBA in the past, but know on my own I will have a lot of trouble coding my first EA.
I was hoping that I could get assistance with the syntax, of the system and some help tweaking the system once its done. I know its a lot to ask for, but from what I have seen on these forums, some of the posters are very friendly and helpful.
Basically the strategy of the EA is based of this article:
http://www.tradingmarkets.com/.site/...14.cfm?a=81414
I took some time to write up what is to my understanding the variables and the conditionals that will be used in the EA version. I stated the default setting, as well as the user definable ones,UD = user definable.
Variables
*ATR = Average True Range indicator for 14 periods (UD)
Var1: Moving Average (UD)
Var2: Var1 + 1*ATR
Var3: Var1 + 1.5*ATR
Var4: Var1 - 1*ATR
Var5: Var1 - 1.5*ATR
Trading Conditions
**Long Position**
//Entry
If positions open = 0 // only 1 position should be open at a time
Open Buy: If Var current > Var -1 period > Var -2 period //Moving average slope is positive, suggestion on a better indicator are appreciate
If open < Var1 && Close > Var 1 //Crosses moving average from below
Enter Buy
//Exit
If close< Var 1 sell //price closes below MA sell
If current=> Var3 sell //price touches target profit of 1.5ATRs
If current=< Var4 sell //price hits stop of -1 ATR
If LastHigh>Var3 && Current<Var3 sell */Closes position if the price crosses the 1ATR and is trading below it in the next period/*
**Short Position**
//Entry
If positions open = 0 // only 1 position should be open at a time
Open Sell: If Var current < Var -1 period < Var -2 period //Moving average slope is negative
If open > Var1 && Close < Var 1 //Crosses moving average from above
Enter Buy
//Exit
If close> Var 1 buy //price closes above MA
If current<= Var5 buy //price touches target profit of -1.5ATRs
If current>= Var2 buy //price hits stop of 1 ATR
If LastLow<Var4 && Current>Var5 buy */Closes position if the price crosses the -1ATR and is trading aboveit in the next period/*
I do not really have any idea how to code the lot sizing and money management part, but I only want 1 standard lot traded at a time and only 1 position open at most. I would like to eventually get this up and running and potentially would like to use this. Any advice or help is greatly appreciated and I will definitely being ample amounts of credit to any contributors. Feel free to PM if you have any questions about the overall strategy or what I am trying to accomplish.
Thanks in advance, and lets make some money
I was hoping that I could get assistance with the syntax, of the system and some help tweaking the system once its done. I know its a lot to ask for, but from what I have seen on these forums, some of the posters are very friendly and helpful.
Basically the strategy of the EA is based of this article:
http://www.tradingmarkets.com/.site/...14.cfm?a=81414
I took some time to write up what is to my understanding the variables and the conditionals that will be used in the EA version. I stated the default setting, as well as the user definable ones,UD = user definable.
Variables
*ATR = Average True Range indicator for 14 periods (UD)
Var1: Moving Average (UD)
Var2: Var1 + 1*ATR
Var3: Var1 + 1.5*ATR
Var4: Var1 - 1*ATR
Var5: Var1 - 1.5*ATR
Trading Conditions
**Long Position**
//Entry
If positions open = 0 // only 1 position should be open at a time
Open Buy: If Var current > Var -1 period > Var -2 period //Moving average slope is positive, suggestion on a better indicator are appreciate
If open < Var1 && Close > Var 1 //Crosses moving average from below
Enter Buy
//Exit
If close< Var 1 sell //price closes below MA sell
If current=> Var3 sell //price touches target profit of 1.5ATRs
If current=< Var4 sell //price hits stop of -1 ATR
If LastHigh>Var3 && Current<Var3 sell */Closes position if the price crosses the 1ATR and is trading below it in the next period/*
**Short Position**
//Entry
If positions open = 0 // only 1 position should be open at a time
Open Sell: If Var current < Var -1 period < Var -2 period //Moving average slope is negative
If open > Var1 && Close < Var 1 //Crosses moving average from above
Enter Buy
//Exit
If close> Var 1 buy //price closes above MA
If current<= Var5 buy //price touches target profit of -1.5ATRs
If current>= Var2 buy //price hits stop of 1 ATR
If LastLow<Var4 && Current>Var5 buy */Closes position if the price crosses the -1ATR and is trading aboveit in the next period/*
I do not really have any idea how to code the lot sizing and money management part, but I only want 1 standard lot traded at a time and only 1 position open at most. I would like to eventually get this up and running and potentially would like to use this. Any advice or help is greatly appreciated and I will definitely being ample amounts of credit to any contributors. Feel free to PM if you have any questions about the overall strategy or what I am trying to accomplish.
Thanks in advance, and lets make some money