[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One moving Ave with 3 markets, Possible: Tradestation



PureBytes Links

Trading Reference Links

-----Original Message-----
From: Tim and Lynn Lee <Timothy.H.Lee-1@xxxxxxxxxx>
To: RealTraders Discussion Group <realtraders@xxxxxxxxxxxxxx>
Date: April 14, 1998 4:02 AM
Subject: One moving Ave with 3 markets, Possible: Tradestation


>RT
>Is it possible to program TS so that a simple moving average can be used on
three markets to generate a signal
>But only if those markets are all triggering, i.e. above or below the
average?
>
>Could anyone supply the Easy Language for that type of system?
>Timothy Lee
>
>
>
>

The following should work:

Inputs: MALen1(10),MALen2(10),MALen3(10);
Vars: MA1(0),MA2(0),MA3(0);

If CurrentBar>1 then begin
        MA1=Average(Close,MALen1) of data1;
        MA2=Average(Close,MALen2) of data2;
        MA3=Average(Close,MALen3) of data3;
        If Close of Data1>MA1 and Close of Data2>MA2 and Close of Data3>MA3
then Buy at close;
        If Close of Data1<MA1 and Close of Data2<MA2 and Close of Data3<MA3
then   Sell at close;
end;

To get this working set up a price chart first with the price series for
which you wish to generate signals.  Then insert data2 and data3 using
Insert/Price Data.  Then apply the system to the chart.  Buy/Sell signals
are always applied to data1.