Search

Free Tradestation Strategy Code!

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);



24 views0 comments

Recent Posts

See All