TradeStation EasyLanguage Strategy

Completed Posted Sep 22, 2013 Paid on delivery
Completed Paid on delivery

I'd like the following strategy coded for TradeStation in EasyLanguage for backtesting purposes.

I. This EA should be coded to use two Moving Averages of my choosing (MA1 and MA2).

II. All of the following must be true for a Buy Order:

a. For the previous bar:

1. The bar close is greater than MA1.

2. The minimum distance between bar close and MA1 is x pips.

3. The maximum distance between bar close and MA1 is y pips.

4. The bar close is above the bar open OR the bar close is above mid-point of the bar.

5. Both MA1 and MA2 are not sloping downward.

6. It must be at least 1 bar after the previously closed buy trade.

b. For the current bar:

7. Current price must be equal to or greater than the previous bar’s close.

8. After the previously closed buy trade (if such a trade exists):

a. The price must have dropped X pips below MA2.

b. Any previous bar must have closed X pips below MA2.

Inputs (a) & (b) can be set to true or false to enable or disable them.

III. All of the following must be true for a Sell Order:

a. For the previous bar:

1. The bar close is less than MA1.

2. The minimum distance between bar close and MA1 is x pips.

3. The maximum distance between bar close and MA1 is y pips.

4. The bar close is below the bar open OR the bar close is below mid-point of the bar.

5. Both MA1 and MA2 are not sloping upward.

6. It must be at least 1 bar after the previously closed sell trade.

b. For the current bar:

7. Current price must be equal to or less than the previous bar’s close.

8. After the previously closed sell trade (if such a trade exists):

a. The price must have risen X pips above MA1.

b. Any previous bar must have closed X pips above MA1.

Inputs (a) & (b) can be set to true or false to enable or disable them.

IV. Other conditions for buy and sell trades:

a. Only one trade can be in the market at a time.

V. Exit Conditions

Each exit can be set to true and false to be enabled or disabled. If more than one condition is selected, the first that occurs will cancel the other(s).

Definition of Risk (R):

Buy order Risk = entry price – previous bar’s MA2

Sell order Risk = previous bar’s MA1 – entry price

1. Stop loss = X% of R

2. Profit target =X% of R

3. Breakeven stop after X% of R pips profit.

4. Trailing stop: TrailStopStartpips = X% of R, Trail By X% of R.

Financial Markets

Project ID: #4954815

About the project

4 proposals Remote project Active Sep 26, 2013

Awarded to:

bfgreyling

Hi, I have completed many Easy Language projects on Freelancer. Please check my feedback.

$122 USD in 5 days
(3 Reviews)
2.7

4 freelancers are bidding on average $564 for this job

glivv

. .

$333 USD in 7 days
(6 Reviews)
5.0
arsingh1212

Interested!

$1578 USD in 30 days
(0 Reviews)
0.0
oromek

Please read pm.

$222 USD in 2 days
(0 Reviews)
0.0