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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

if lastTradeLoser then

begin

if currentContracts < numPyraMids * lotsize then

Buy ("Turtle20Buy") lotSize contracts next

bar at buyPrice stop;

if currentContracts < numPyraMids * lotsize then

Sellshort ("Turtle20Sell") lotsize contracts

next bar at sellPrice stop;

if currentContracts < 4 * lotsize and debug then

print(date," 20sellPrice ",sellPrice:6:6," ",

currentContracts);

end;

332

TRADESTATION AND EASYLANGUAGE

if lastTradeLoser = false then

begin

if currentContracts < numPyraMids * lotsize then

Buy ("Turtle55Buy") lotSize contracts next bar

at buyPrice stop;

if currentContracts < numPyraMids * lotsize then

Sellshort ("Turtle55Sell") lotsize contracts

next bar at sellPrice stop;

if debug then print(date," ",iCnt," 55sellPrice ",

sellPrice:6:6);

end;

If mp = 1 then Sell ("TurtleSys1LExit") from

entry("Turtle20Buy") next bar at

lowest(low,exitChanLen) stop;

If mp = -1 then BuyToCover("TurtleSys1SExit")from

entry("Turtle20Sell") next bar at

highest(high,exitChanLen) stop;

If mp = 1 then Sell ("TurtleSys2LExit") from

entry("Turtle55Buy") next bar at lowest(low,20) stop;

If mp = -1 then BuyToCover("TurtleSys2SExit")from

entry("Turtle55Sell") next bar at

highest(high,20) stop;

If mp = 1 then Sell ("TurtleLExit2N") next bar at

entryPrice - stopLossPts stop;

If mp = -1 then BuyToCover("TurtleSExit2N") next bar at

entryPrice + stopLossPts stop;

www.rasabourse.com

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

Saved successfully!

Ooh no, something went wrong!