"Indicator Crosses Above Indicator" doesn't generate trades with parameter sliders exposed
Author: djmundus
Creation Date: 7/18/2018 5:56 PM
profile picture

djmundus

#1
I created a rules based strategy that uses the "Indicator crosses over Indicator" rule to trigger when a fast moving average crosses over a slower one.

If I backtest the strategy, I see hundreds of trades. If I go into that rule and click on the sliders to optimize the time window of each indicator, no trades are generated. If I deselect the optimization slider buttons and backtest, I see trades again.
profile picture

Eugene

#2
Not enough detail. Please provide the following information:

1. Are preferred values enabled? Refer to the User Guide if unsure.
2. What moving averages specifically and what settings does each of them use?
3. Single symbol or Multi-symbol mode, Position Sizing, and Data Loading settings
4. Symbol(s) and Data provider
profile picture

djmundus

#3
Preferred values are not enabled.

KAMA(5) and EMA(60,modern) are the moving averages, though I've tried it with multiple different MAs with the same result.

Multi-symbol mode, 5% equity position sizing, data on demand is checked if that's what you mean by "Data Loading" settings.

List of symbols I've backtested against (though I got the same results on other data sets):

AABA AAL AAOI AAPL AAXN ABEO ABMD ACAD ACGL ACHC ACHN ACIW ADBE ADI ADP ADSK ADVM AFSI AGMH AGNC AKAM AKAO AKRX ALDR ALGN ALKS ALNY ALRM ALTR ALXN AMAT AMBA AMCX AMD AMGN AMKR AMR AMRN AMTD AMZN AOBC APPN ARCC ARNA ARQL ARRS ARRY ARWR ASML ASNA ATHX ATRA ATRS ATVI AVGO AVT AXAS AXON AY BBBY BECN BGCP BGNE BHF BIDU BIIB BILI BIOS BL BLCM BLDP BLDR BLMN BLUE BMCH BMRN BRKS BZUN CA CAKE CAR CARA CARG CASA CATM CBAY CBLK CBOE CCRN CDEV CDK CDNS CDW CELG CENX CERN CERS CGNX CHKP CHRS CHRW CHTR CLNE CLVS CMCSA CME CNSL COLL COMM CONE CONN COOL CORT COST COUP CPLP CPRT CPRX CREE CRON CROX CRSP CRTO CRUS CRZO CSCO CSFL CSIQ CSX CTRP CTSH CTXS CY CYBR CYRX CZR DBX DEPO DERM DISCA DISH DLTH DLTR DNKN DNLI DOCU DOX DRNA DRRX DRYS DVAX DXCM EA EBAY ECYT EDIT EGAN EIGI ENDP ENPH ENTG EQIX ERIC ERII ESIO ESPR ESRX ETFC ETSY EVBG EWBC EXAS EXEL EXPD EXPE EXTR FANG FAST FATE FB FEYE FFIV FGEN FHB FINL FISV FITB FIVE FIVN FLEX FLIR FNGN FNSR FOLD FORM FOSL FOXA FSCT FSLR FTNT FTR FULT FWONK GBT GDS GERN GGAL GIII GILD GLNG GLPI GLUU GLYC GNTX GOGO GOOG GOOGL GPOR GPRO GRPN GSM GT GTLS GWPH HA HAIN HAS HBAN HCSG HDP HDS HIBB HIMX HMSY HOLX HOMB HOPE HPT HQY HRTX HSIC HTHT HTLD HZNP IAC IBKR ICHR ICPT IDRA IDTI ILG ILMN IMGN IMMR IMMU INCY INFN INFO INO INOV INSY INTC INTU INVA IONS IOVA IQ IRBT IRDM IRWD ISBC ISRG JBHT JBLU JD KANG KERX KEYW KHC KLAC KLIC KRNY KTOS KTWO LAMR LAUR LAYN LBRDK LBTYA LBTYK LE LGCY LILAK LITE LKQ LLNW LOGM LOXO LPSN LRCX LSCC LSXMA LSXMK LTRPA LULU LX LXRX MAR MAT MB MBFI MCHP MDB MDCO MDLZ MDRX MDXG MEDP MEET MELI MIK MITL MKSI MLCO MNST MOMO MPAA MRTX MRVL MSFT MTCH MTGE MTSI MU MXIM MYL MYOK NAVI NBIX NFLX NIHD NKTR NTAP NTCT NTES NTLA NTNX NTRS NUAN NUVA NVAX NVCR NVDA NWSA NXPI NXST NXTM NYMT OCLR OCSL OCUL ODFL ODP OKTA OLED OLLI ON ONB OPK ORBC ORLY OSTK OXFD OZRK PAAS PACB PACQU PACW PAYX PBCT PBYI PCAR PCH PCRX PCTY PDCE PDCO PDLI PEGI PENN PEP PETS PFG PFPT PGNX PI PLAY PLCE PLUG PNFP PODD PPC PRAH PS PSEC PTC PTCT PTEN PTLA PYPL PZZA QCOM QLYS QRTEA QRVO QSII RARE RCII RDFN RDUS REGI REGN RGNX RIGL RMBS ROIC ROKU ROST RP RPXC RUN SABR SAFM SAGE SBAC SBGI SBLK SBNY SBRA SBUX SEDG SFIX SFLY SFM SGEN SGH SGMO SGMS SGYP SHPG SINA SIRI SLM SMPL SNBR SNH SNPS SONC SPAR SPI SPLK SPPI SPWR SRCL SRNE SRPT SSNC SSRM STLD STX SUPN SWKS SYMC SYNA SYNH TEAM TELL TERP TGTX TILE TMUS TNDM TPIC TRIP TRMB TROW TRUE TRVG TSCO TSEM TSLA TSRO TTD TTMI TTOO TTS TTWO TVTY TWNK TWOU TXMD TXN UBNT UBSH UBSI UCTT ULTA UMPQ UNFI UNIT UPL URBN USAT VCEL VEON VIAB VIAV VIRT VKTX VNET VOD VRAY VRNT VRSN VRTX VSTM WB WBA WDAY WDC WEB WEN WERN WETF WIN WIX WMGI WRLS WTFC WYNN XEL XLNX XNET XOG XRAY YNDX YRCW YY Z ZAGG ZION ZIOP ZNGA ZS
profile picture

Eugene

#4
Sorry, I was wrong: it's not an issue of settings or whatever. I guess I know what's happening. Your Strategy Parameters box now looks like this:



And there are two issues with this:

1. 4 parameters have an identical name but each parameter name should be unique for the Optimizer to function correctly. This is an unfortunate case when the Rule Wizard has to apply a default name ("Period"). Unfortunately, editing Strap names and values in the Optimization Control is disabled for Rule-based Strategies (by design). To change the "Period" to e.g. "Period1", "Period2" etc. you'd have to click "Open code in new Strategy window" and edit these lines by hand e.g.

CODE:
Please log in to see this code.


Also note that double clicking an optimization result on the Results tab would cause a handled exception rather than run a backtest with chosen settings. However, if you edit the code as above you'll gain back this feature.

But we're not done with the editing yet.

2. Another problem is that by default they're all set to the same value (10) as you can see. A crossover of 10-period indicator with itself won't generate any trades. No wonder you're not seeing any. So to see trades just change the sliders to unique values each and rerun your portfolio backtest.

Your assumption about "no trades are generated" is incorrect. They are. Just scroll the Results tab way down to see that there are many, buried under the multitude of zero-trade entries like:

CODE:
Please log in to see this code.


Bottom line:

1. Rename the parameters uniquely
2. Edit the parameter ranges so that they don't match i.e. the fast MA period must not be equal to the slow MA period (an indicator cannot cross itself)

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).