Thread: ATR Bound EA
View Single Post
  #1 (permalink)  
Old 06-10-2009, 09:32 PM
Styex Styex is offline
Junior Member
 
Join Date: May 2009
Posts: 15
Styex is on a distinguished road
ATR Bound EA

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:
How to Use Average True Range for Short-Term trading

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/*
Reply With Quote