top of page
Search

Free Tradestation Strategy Code!

Writer's picture: Kyle SchultzKyle Schultz

Below is the Tradestation Easylanguage Code for a Eurocurrency futures momentum strategy. This is set up on a 2 minute EC on data1 and 30 minute EC data2 chart in Tradestation:


inputs:

iContracts(1),

iProfit(400),

iStop(500),

iPercent1(0.0015),

iPercent2(0.002),

iPercent3(0.004),

iMA(50);


Variables:

Tim(0),

iBars(30),

iADX(30),

iADXLength(20);


If Close/Close[iBars]>(1+iPercent1)

And Close/Close[iBars+iBars]>(1+iPercent2)

And Close/Close[iBars+iBars+iBars]>(1+iPercent3)

And C of Data2>Average(C of Data2, iMA)[1]

And ADX(iADXLength)>iADX

Then Buy ("EC LE") iContracts Contracts Next Bar at Lowest(L,5)[1] Limit;


If Close/Close[iBars]<(1-iPercent1)

And Close/Close[iBars+iBars]<(1-iPercent2)

And Close/Close[iBars+iBars+iBars]<(1-iPercent3)

And C of Data2<Average(C of Data2, iMA)[1]

And ADX(iADXLength)>iADX

Then Sell Short ("EC SE") iContracts Contracts Next Bar at Highest(H,5)[1] Limit;


SetProfitTarget(iProfit*iContracts);

SetStopLoss(iStop*iContracts);



711 views3 comments

Recent Posts

See All

3件のコメント


oscar911business
2023年4月13日

Thanks for sharing with the community. I am able to duplicate your results approximately, but assuming $0 slippage and commissions. I realize limit orders have no slippage, but shouldn't an allowance for slippage of stop orders be made?

いいね!
oscar911business
2023年5月20日
返信先

SetStopLoss does not use limit orders in Tradestation, FYI.

いいね!
bottom of page