Sverige
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
Posts: 5 since Aug 2014
Thanks Given: 1
Thanks Received: 1
|
Maybe this can be an EasyLanguage version:
(No debugging done)
//Moving averages:
Var: mal(0), mah(0);
mal = Average(Low,3);
mah = Average(High,3);
//Trend analyzer:
Var: trnd(0), TotalPrice(0);
TotalPrice = (O+H+L+C)/4;
Trnd = LinearRegSlope(TotalPrice, 3);
//Uptrend VS Downtrend
Var: c1(0),c2(0);
c1=(Trnd[1]>0);
c2=(Ttrnd[1]<0);
// 3-Bar System long orders
If Marketposition<=0 and c1 then
BUY 1 contract at mal[1] limit;
If Marketposition=1 and c2 then
SELL next bar at mah[1] limit;
// 3-Bar System short orders
If Marketposition>=0 and c2 then
SELLSHORT 1 contract at mah[1] limit;
If Marketposition=-1 and c1 then
BuyToCover next bar at mal[1] limit;
{
However, the author suggests the following values based on the tests carried out:
mal=Average[17](low)
mah=Average[17](high)
Then use these instead:
mal = Average(Low,17);
mah = Average(High,17);
trnd=LinearRegressionSlope[12](TotalPrice)
Then use this instead:
Trnd = LinearRegSlope(TotalPrice, 12);
}
|