31.07.2021 Views

Ultimate Algorithmic Trading System

Using automated systems for trading in stock markets

Using automated systems for trading in stock markets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If condition1 and condition2 then buy this bar on close;

If not(condition1) and condition3 then sellShort this bar on close;

If barsSinceEntry = holdPeriod then

Begin

if marketPosition = 1 then sell this bar on close;

if marketPosition =-1 then buytocover this bar on close;

end;

Turtle with LTL Filter, Pyramiding and Position Sizing

inputs: absEntryChanLen(55),entryChanlen(20),exitChanLen(10),

lastTradeLoserFilter(TRUE),accountSize(100000),

riskPerTradePer(.01),numPyraMids(1);

328

TRADESTATION AND EASYLANGUAGE

vars:lastTradeLoser(true),mp(0),virtmp(0),tradeProfit(0),

virtBuyPrice(0),virtSellPrice(0),

virtLongLiqPrice(0),virtShortLiqPrice(0),

virtLongLoss(0),virtShortLoss(0),

myFillPrice(0),N(0),N$(0),dollarRisk(0),lotSize(0),

stopLoss(0),buyPrice(0),sellPrice(0),

hh20(0),hh55(0),ll20(0),ll55(0),iCnt(0),initPrice(0),

stopLossPts(0),debug(TRUE);

mp = marketPosition;

if mp = 0 then

begin

N = AvgTrueRange(20);

N$ = N*BigPointValue;

dollarRisk = AccountSize * riskPerTradePer;

lotSize = IntPortion(DollarRisk/N$);

if lotSize < 1 then lotSize = 1;

lotSize = 1;

StopLoss = 2 * N$ * lotSize;

StopLossPts = 2 * N * lotSize;

StopLossPts = 2000/bigPointValue;

hh20 = highest(high,entryChanLen);

hh55 = highest(high,absEntryChanLen);

ll20 = lowest(low,entryChanLen);

ll55 = lowest(low,absEntryChanLen);

end;

www.rasabourse.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!