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



723 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.

按讚

Required Disclaimer - Commodity Futures Trading Commission: Futures and options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This website is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this website. The past performance of any trading system or methodology is not necessarily indicative of future results

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

© 2020 Algorithmic Futures, LLC - All Rights Reserved 

Privacy Policy  Terms of Service

  • LinkedIn
  • Facebook
  • YouTube
bottom of page