Australian (ASX) Stock Market Forum

Creating an Automated System

Joined
23 June 2006
Posts
3
Reactions
0
There are 2 main reasons for creating an Automated system.
1) To test your theory.
2) To remove the psychology from your decision making process.

Here is some code written in Easy Language used on the Trade Station platform. This sholud give you an idea of how to create a simple system.

------------------
(setup)
Open a chart and set the time scale to 3 mins, Then click on “Insert” then “Symbol” and enter the same symbol again and set the time frame to 15 min. This second symbol will now be Data2.
Set you inputs to suit, here we can see I have set the Profit Target to $2000 which means 200 pips on a FX chart. The Stop and Break Even Stop is set to $400.
The code will now look for MA crossovers on a 3min chart when the 15 min chart is same. So it will only enter long trades when the fast avg on the 15 min chart is above the slow avg on the 15 min chart and visa versa.
--------------------------------------
(The code)
{By John Watters//Hurricane-fx//2006}
inputs: Price( Close ), FastLength( 7 ), SlowLength( 50 ),
ProfitTargetAmt( 2000 ), StopLossAmt(400),
BreakevenFloorAmt( 400 );{Declaring Input Values}

variables: FastAvg( 0 ), SlowAvg( 0 ),FastAvg15( 0, data2 ),
SlowAvg15( 0,data2 );{Declaring the Variables}


{Defining the Variables}
FastAvg = xAverage(Price, FastLength);
SlowAvg = xAverage(Price, SlowLength);
FastAvg15 = xAverage(Price, FastLength)data2;
SlowAvg15 = xAverage(Price, SlowLength)data2;




{Creating the Conditions}

Condition1= FastAvg15 > SlowAvg15;
Condition2= FastAvg15 < SlowAvg15;
Condition3= FastAvg crosses above SlowAvg;
Condition4= FastAvg crosses below SlowAvg;




If CurrentBar > 1 and
{used to avoid spurious cross confirmation}
Marketposition <1 and {Confirms we are not already in a Long Position}
Condition1 and Condition3 then

Buy ( "BUY" ) next bar at market ;




If CurrentBar > 1 and
{used to avoid spurious cross confirmation}
Marketposition >-1 and {Confirms we are not already in a Short Position}
Condition2 and Condition4 then

Sellshort ( "SS" ) next bar at market ;


{DETERMINE TRADE EXIT}

If Marketposition <> 0 {Says If we are in a position then}
then BEGIN
SetProfitTarget( ProfitTargetAmt ) ;
SetStopLoss( StopLossAmt );
SetBreakeven( BreakevenFloorAmt );
end;
---------------------------

Mr Hurricane
 
Hurricane,

Good to see you put the system up.

Just as a matter of interest have you tried the system with three averages, i.e. slow, medium and fast?

For example:

1. SlowAvg(21) MediumAvg(35) FastAvg(85), or
2. SlowAvg(15) MediumAvg(30) FastAvg(50).

One of the good things with simple systems is the ability to try different approaches and analyse the behaviour.

Cheers.
 
Whoops, should read:

1. FastAvg(21) MediumAvg(35) SlowAvg(85), or
2. FastAvg(15) MediumAvg(30) SlowAvg(50).
 
September 9.8%

The Trilogy performance for September was 9.8%

http://www.Hurricane-FX.com/Performance.htm

Moderator's Note: I have allowed this post to stand- it would normally be considered spam/spruiking and the poster would be banned immediately but as you have contributed in substance before on ASF I will only suggest a warning about links to external sites and the promotion of your automated trading service.

Please read the forum code of conduct and posting guidelines asap.

RichKid
moderator
 
Top