Home
Back Testing User Guide
Contents
1. Tip if you make a mistake just click on the order definition again shown in figure 2 2 Money Management e Click on the capital management button as seen in section 2 of figure 2 and the screen shown in figure 5 will open Our initial capital of 100 000 should already be defined In this case set the commission by order and the minimum commission to 0 then click OK to close the window For this example leave everything else the same as we want to invest all our money on a compound basis e We wont define any stops for this example 4B CMC Markets Capital Management Capital Initial capital D n Commission Hat Commission by order In eos in 5 transaction Minimal commission lo L1 Market commitment Maximal total commitment 100 Capital Maximal commitment by transaction 100 Ue capital e Minimal commitment by transaction 0 capital e Positions management wl Invest profit 1 stop for all positions Accumulate positions i stop for each position Jf Accumulate positions is checked successive buy for short instructions can De added fo increase the current position In this case you can choose to define stops for each position distinctly or for all accumulated positions Roundness management gt Round stocks or contract number to lower unit i Round stocks or contracts number to upper unit OK Cancel Figure 5 configuring capital managem
2. NAJIB 59 Lal Ts B Reports G5K Enim Date 31 May 2006 Relat Pee Commission i 9 Mar 200 Ls ZR 10 Fak 2006 31 lan ape 20 tan 2006 20 Hew 200 28 Orr 2006 21 ext anos 6 Ap 2005 zu Ma SIDEN 9 Mar zone snnt 1 Mar 2006 Long 3712 50 4319 30 708 00 25 je Spe lal 725 00 20 Nov 2008 cing 29 Cet 2008 ener 21 Cet 2005 Long s ze ort 27 Fel 2005 20 Ma zm ong Mcd Backtert oss Figure 54 trades list including the direction 60 4B CMC Markets H GiasoSnmthhine Gash Bet Bid Chart 8 Be 7 X 7 mw 1 Year v Dal e j Add Iridicator Only a third of the capital on shorts over the long positions gt AN 1468 1492 75 mar 1540 50 494 2006 Feb Mar Apr May Jun v e JO 570 Figure 55 chart showing the backtest To create the optimisation follow the instructions below e f you click on modify backtest on the detailed report it will take you back to programming of our backtest e n the code change the Average rueRange 30 to AverageTrueRange number both for the buy and sellshort e Under the optimization parameters section shown in figure 20 Click on add and fill in the fields like figure 56 below so that we have a range for our ATR from 20 to 40 with increments of 1 e Click ok and then validate the program again The results figures 57
3. Cl tindicator CROSSES UNDER WAA Condition when MACD Signal 1 indicator IF pi THEN 1 crosses under Signal 1 BUY 100000 SHARES AT MARKET THISBARONCEOSE REM Gel with properties If condition is met then buy the quantity on the close of the bar Indicators MACDline 12 26 9 close Indicatar4 Exponential4verage 2 MACDline 12 26 3 rlosey tc indicators CROSSES OVER indicators IF C2 THEN SELL AT MARKET THISBSRONCLOSE ENDIF Figure 14 shows the program generated gt Enter a name for this backtest and then validate the program Figures 15 18 display the detailed results and chart produced In this case it seems that this may have been a good trading strategy with 78 profitable trades remember percentage return doesn t include gearing 21 KEES Cie ee 8 gr equ Rt Thr di loaiad Rar MAD 1830 SIS L e m ee Red Tala het brab oes Prot Grass Los Pr ft Facto Tota Hambar of Tracks Barent Rate RTM Traces Los Tapes Even Tracers vg Loang Tas Eid baish of Trade Pront Lange winning Trade Largest Long Trade Arg Bars D Uae Aug Hari Beetwasrr Tade bw Bar ri Winning Tracer Arg Bars in Loang Taan hg Bats n Even Traces Percent of Tine in the Marks Total Combe Wer Coreecutye winning Trader Max Corper tee Loan Traces Mans dirac dotar Mir equity Fun ur Rehan on bile capitals Mr Becke Mi Ix Long Tradal Fat Trades 7494 DE SLEID S37 DE T3 Figure 15 d
4. Mogh Backtest urat ie mas mm 141504 00 mm 1167800 mm 159136 0n Gel KR Chr EE F5915 25 EIE Bell Tee Figure 59 optimised orders list based on ATR of 31 days 64 etd lot Heport LSR elis Uria ee 4 Xr pr y Ba f D Enpy Cals 31 May 26 ig em 31 20x 20 her anxii ZI XXn Sop 2005 6 Ma TO Est Pate Troe Bae TD 12 Xr Soe Shot sd Mer cime lcgi ZODE Sort iilmn ite Long dg a 2008 Short zu How anre Lera OC zm st 2b Oct 06 Long D rg 2008 Short D Mar O06 Long Ape Perr PEJ 3113 50 1421 01 Tipo 93 00 2 FLU j15120 0d 1213 72 1696 75 Figure 60 optimized trades list E m fent Part Corio La P ia 14 61 sia 1 90 65 IA Glazosmithkiine Gash Bet Bid Chart ree maya Figure 61 optimised graphical representation This strategy from being barely breakeven has been turned around using the optimisation of the indicator by 16 excluding gearing This goes to show how valuable or powerful backtesting can be 66
5. item for a posters Accumulate potione E top for each postian if Actiaralate portar E phiactisd Steam Dur pr shot eel ptione can Le agded Lo es Hoe current pasion In Ate Case et C Gss bo Metre shona Kr Sach pestem laich ex for a ager abe pos bors Hondse mapapmrzm We Round ats or contract nmp to bw url Z Ruri st das Cor contiacte cures t upper urit o cancel Figure 11 the capital management window Initial Capital You can define the initial capital from one of two ways Either via the capital management under the capital section or when defining order definitions i e like in the first example when entering a buy condition or entering a short condition As previously stated it does not create margin trading hence for example if you decided to invest 100 000 on GBPUSD at a price of 1 8000 this will give you a position of 55 555 However with an FX account margin is 196 so you could effectively buy 10 000 000 As another example if you wanted to buy 100 000 worth of BP UK stock at 625 that would be 156 both rounded down but really at 396 margin you could buy 5333 The initial capital is in USD but here we are only concerned with the quantities Hence you need to adjust the initial capital to reflect your gearing or calculate the returns yourself by multiplying the factor of leverage Commission This can only be defined by order and not by lot as suggested 16 Commission by order can be either set per fixed
6. Aug Losing Trade ctrl avatar al Trade Pritt Largest Wioning Trad Trade Largest Loong Trade Avg Bars y Traces Avg Bers Beptyweer Traces Ae Ears in Wwinnne Trades Aug brc iri ere Tracks fg Bers n Evan Traces Percent nf Tren the Maket Total Cen rennes Max consecuta wm Trades Ma Coreecutke leen Traces May draw rein Mall equity rur un Return pp nitial rapit al eacus T ane Figure 41 detailed statistics for the backtest showing a good profitable strategy Insert Function As shown in figure 20 under the creation by programming tab there is a insert function button This brings up a window with all the available functions which are categorized including the ones that you create as seen below in figure 42 It also provides help with more information about a chosen function 46 ProBuilder Functions List Categories Available functions Constants Operators keywords ShortonMarket Mathematic functions ICountofLongsharee Time functions CountofShortShares IPraRealTime indicators ountotPasitian ser indicators IEntryIndex IBacktest commands IEntryC ate Backtest variables Previous Trades Performance Help associated with the function his variable indicates if vou have current positions on the market Add Cancel Figure 42 functions list available from the insert function button State Variables The three possible variables are OnMarket LongOnMarket and ShortOnMarket refer to being flat
7. long or short Hence this function allows you to know the state of your backtest portfolio The importance of this is associated with knowing your position s direction As the reasons why you want to execute orders will not always be the same Different results are produced dependent on being long short or flat E g the exit of a long and an uncovered sell are two different strategies hence the former is a position closed and the latter is being opened Examples on the use of this order are given in figures 43 and 44 Logical Operators 47 The operators described below are used to implement combinations of comparisons NOT a Logical NOT a OR D Logical OR a AND b Logical AND a XOR b Logical Exclusive OR An example of the use of these functions is given in figures 43 and 44 AS Commands and variables are linked to one or more strategies If you do not define your strategy the backtest will create one strategy and all commands are then linked to it There is no limit to the number of strategies you can create The keyword AS is used to classify several strategies within the same program Hence you use this function so that the instructions only apply to this strategy An example is provided below in figure 43 Translation of program REM Ee IF close gt AVERAGEBO iclose AND MOT OnMarket THEN BUY SO Ss Liquidity AT MARKET AG moving average ENDIF REM sel on the breakout af t IF close low BarIn
8. a long position is not opened but the position will be flattened if no count is used all the position is bought An example of the use of these commands as market limit and stop is shown in figure 32 REM BL REM is used as a reference to yourself you do not need to enter a REM line everything after REM on the line is REM Buy 10000 smares at limit price 25 25 Ebay price now 30 02 Order conditions BUY 10000 Shares AT 25 25 LIMIT Capitals or lowercase can be REM Bun JO shares at stop price 32 5 used it does not matter BUY 10000 Shares AT 32 53 STOP Figure 32 shows an example of commands used to program orders Quantity There are a number of alternatives that can be used instead of defining the quantity as the number of shares SHARES CASH JeCAPITAL JeLIQUIDIT Y number of shares amount of cash units percentage of the current capital percentage of the current available cash Examples of these commands are given below in figure 33 38 REM Buy 10000USE worth of stack Div 10000 Gash AT MARKET REM Bury using Die Of the current capital when dow chemical i 30 50 curent 38 34 BU 50 9scapital AT 30 50 LIMIT REM Bury usna ZC OF avaiable cash when dow chemical 15 35 12 BUT 20 9Ssbiguidit AT 45 12 STOP REM all trades that exit like sell and exitshort you do nat need to enter the IO irt SELL AT MARKET Figure 33 commands used to set quantities Date of execution If not instructed orders are
9. amount per transaction or by percentage only in dollars A minimum can also be set This will take into account both sides of the trade i e on opening and closing Market Commitment The amount of money you wish to allocate to any trade can be set either as a percentage of capital or cash or a fixed US dollar cash amount with a maximum and minimum commitment per transaction Positions Management You can choose to invest any profit that is accumulated by ticking the box invest profit By ticking accumulate positions when the criteria for your entrance on long short position is reached the backtest will effectively add to your position The stops on accumulative positions can be the same for the entire position or for each position simply tick the appropriate box Roundness Management When entering positions you can either round the number or shares up or down as fractions cannot be bought sold again define the criteria with the appropriate box Stops When defining stops using the assisted creation there are four choices as in Figure 12 17 This stop closes a position when loss reach a specific value or a specific percentage of the position amount commission included _ Activate this stop Maximal loss Exit Figure 12 shows the different types of stops that can be used Stop loss This stop closes a position when a loss reaches a specific value or a specific percentage of the position amoun
10. executed on the next bar however market orders can be executed before or after this bar using the following commands ThisBarOnClose at the close of the current bar NextBarOpen at the open of the next bar default order NextBarClose at the close of the next bar TodayOnClose at the close of the current day TomorrowOpen at the open of the day after TomorrowClose at the close of the day after An example can be seen in figure 34 below 39 REM all vou have to dais anter one af the date of execution commands arter the word MARKET This can be upper or lower BUY 10000 Shares AT MARKET ThisBarOnClase 4 case or a combination does not matter Figure 34 use of when to execute commands Price Terms These terms are technical analysis basics used to emphasize certain aspects For example when calculating a moving average it can be based on the open and close or a formula derived upon the high low and close as in figure 37 the weighted moving average is calculated on the closing price or periods to the prior 30days The terms that can be used with there definitions are Open Opening price of the current bar High Highest price of the current bar Low Lowest price of the current bar Close Closing price of the current bar OpenOfNextBar Opening price of the next bar Time Frames You can also use other time frames for your program see below for the list of functions and descriptions Minute Minute of the c
11. 0 Modify Backtest Close Figure 8 orders placed in our backtest The trades list tab in figure 9 below shows our 2 trades and their direction 11 Tel Pars HL abs Bn T Nadal Feit coram e en 1B Wa DOCS 1 00r Jk 30S Long Madir Ditert rep Figure 9 the 2 trades and their direction The chart below in figure 10 shows our backtest results which can be saved using the paintbrush icon 12 This part of the chart shows our total equity changing with time when holding the position flat lines indicating that no positions are being held ir UKADD Hides caeli Galle Cliart m cuum ds al e E Skok WEN 79 1 Year kad Daily ww Add lni amo Days the position was held also shows direction and quantity Price chart shows the buying and selling execution of orders RSI indicator Paintbrush icon Figure 10 charting results of our backtest used to save templates alues you get for your backtest maybe different unless you use the same start and end dates This is because the first and last date is used as the standard default We will see later how this can be changed Tip To read the chart more clearly you tick the value boxes under the chart options in the options menu in Marketmaker as seen in figure 11 Then whichever chart you look at as in figure 12 the value box is displayed providing more detailed information as the chart is read for you 13 Change Pas
12. 00 phu wl own d i lj d l l n ipli i lull d ih ud M Tu i UU i de e Figure 24 GBPUSD chart with backtest results e f you click on modify backtest on the detailed report it will take you back to programming of our backtest Now we will create the optimization change the sell short figure from 37 to number as seen in figure 25 Change this from 37 to number so that optimization conditions can be defined for number 31 REM Short indicator Chancel 7 CT ndicatar l numbe IF c1 THEN SELLSHORT 100000 SHARES AT MARKET THISBARONCEOSE ENDIF REM Exit short Indicator Chandle 2 clase cz ndicatarz lt lt 37 L IF C2 THEN EXITSHORT AT MARKET THISBARONCLOSE ENDIF Figure 25 conditions redefined to enter our short e Under the optimization parameters section shown in figure 20 Click on add and fill in the fields like figure 26 so that we have a range for our entrance trade from 32 to 40 with increments of 1 New Parameter Jame used in the program number abel displayed in the interface number Parameter restriction gt O Optimizing Minimal value 22 Maximal Value 40 Step 1 OK Cancel Figure 26 defining the optimization e Click ok and then validate the program again The below results figures 27 31 are now produced 32 Detailed Report fug SEES All Trades Long Trades Short Trades Total Net Profit 8283 92 pc 8283 02 Gross pr
13. 61 are now produced 61 New Parameter Jame used in the program number abel displayed in the interface number Parameter restriction Optimizing Minimal value Maximal Value Step Optimize Report iel Met Profits TP etum on Capit Max Draw Bower Mb Orders Bra Winning Trad Expectation number 16729 25 16 72 1917 50 10 50 00 104 87 aal 15729 25 16 72 917 50 10 50 00 104 8795 32 e 10 50 00 104 8795 33 mH 50 00 UNES 16 7 Ta 104 8795 34 i 50 009 104 8795 35 104 87 104 8796 i 50 104 87 50 00 104 87 50 00 104 87 40 16729 25 16729 25 16729 25 16729 25 16729 25 16 7390 J 10917 50 40 10917 50 10917 50 16 73 16 73 o47 7 79 647775 6477 75 6477 75 6477 75 6 48 6 48 6 48 5 46 6 48 6 48 9 370 5371 50 213 25 Figure 57 optimisation report for AVT values 20 40 days shows 31 as best 45 3795 415 2700 0 21 19789 00 19789 00 19789 00 6 46 19789 00 19789 00 18588 30 30 00 30 009 30 0096 10 20 00 10 30 00 25 68 25 68 25 6890 23 60 25 68 D 25 68 saam 33 33 25 00 25 68 20 13 20 13 20 1395 20 21 22 23 24 25 20 7 2B 20 62 Detailed Report GSK optimised All Trades Total Net Profit 16645 25 Profit Fact
14. Back Testing User Guide AB CMC Markets INTRODUCTION The function of backtesting is to test a trading strategy on historical data to see if it could work for future trades to evaluate its profitability before risking any money This document contains the basics of creating a backtest All backtests are done in a similar way to this document There are two ways to create a backtest using the prorealtime charting within Marketmarker either by using the assisted creation or by programming Advantages e Saving time and money on strategies that don t work e Optimizing strategies e Creating winning strategies will make money Disadvantages e Previous trends may not be a representation of the future trends particularly when markets turn sharply e g dotcom boom in 2000 e Marketmaker does not allow program trading e Capital management does not consider margin trading e Chart data is only bid based so it doesn t take into account costs of spread although commission can be included to represent this e Costs of rollovers for cash or spot instruments and the cost of carry model for futures is also not represented WARNING The strategies provided in this document are only given to help you understand the use of advanced technical analysis and not suggesting that you try any of these strategies for yourself as they may or may not be profitable You may need to modify or optimize these strategies in addition to adjus
15. SI long zi amm a d 22 Ferr znos 25 Feb 2005 Long 3 z1 a T Mod Backrest Ce Figure 17 the 14 trades created by our backtest showing direction 24 Dec 2006 Feb Apt May il gre e e Figure 18 the graphical representation of our backtest Optimization You can optimize your backtest to try and produce greater profits by redefining parameters so that system can calculate what the best parameter will be for optimum results It will be easier to understand with an example Create a GBPUSD spot chart and add a CMO chandle momentum indicator leaving the default properties 25 We are looking at the decline taking place between 10 Mar 05 to 30 Nov 05 as seen in figure 19 We will be shorting when CMO is gt 37 and closing our short when CMO is lt 37 We will then optimize this strategy so that our entrance price is at its optimum and see what changes if any take place with our return on capital E Spot British Pound ys US Dollar Bid Chart G O0 E KM Ery 4K Z m 1 Year Daily Add Indicator Te MANUS nz c NN Eo D em IT Finance com Data is real time Mar Apt May jun Jul Aug Sen Figure 19 GBPUSD chart with a CMO indicator e To create the backtest on this chart simply click add indicator then click on the backtest tab create backtest using the assisted creation 26 e Click on short and then CMO on the chart e Define the conditions to short 100 000 when Chande 1 is gt to a valu
16. ades Long Trades Short Trades Total Net Profit EBS 4247 25 Gross Profit 19878 b 19151 00 725 00 Gross Loss S 5137 50 Profit Factor Total Number of Trades Percent Profitable 25 BR Winning Trades 4 3 S emm Losing Trades Even Trades Avg Trade Net Profit Avg Winning Trade Avg Losing Trade Std Deviation of Trade Profit 4064 02 72 77 1003 21 Largest Winning Trade 14040 B0 42040 725 00 ng 2528 50 Avg Bars in Trades Avg Bars Beetween Trades Avg Bars in Winning Trades Ava Bars in Losing T Trades 17 56 Avg Bars in Even Trades nja Percent of Time in the Market Total Commission Max Consecutive Winning Trades Max Consecutive Losing Trades Max craw down Max equity run up 22610 50 23468 50 7752 50 Return on initial capital 0 17 4 25 4 41 Modify Backtest close Figure 52 detailed statistics report showing a flat strategy 58 Mnt Te Me part GSE 1 Busy ical 21 may 2006 Cell Enter Dua 2006 Buy rer 1 Mar 2006 Sal Enter J0 Feb 2000 BY Enter SCH Jai anns Sg ka 28 Jee SCS By Enter an Nae 20685 5l Enter z oct 2005 buy Enter 21 DGT TB rei iEnter Ja57BB zh WES TSH id373j D0 aamir 0 OMT 73 34006 DO 451 2x14 DU 151137 00 jd5834 50 145822 0 Connor E Apr 2005 ELA Enter 20 Mar Ap dl nts 22 Fel 2005 Bu Enter Mody Backrest ese Figure 53 the orders list for this test J26102 00 215 00
17. dex EntryIndex AS moving average THER ne low af the ertry bal SELL AT MARKET 45 moving average ENDIF Figure 43 the use of the function AS in a backtest If the closing price is greater than moving average based on 50 period closing price and you have no positions then buy 50 of the available cash at market price for our strategy moving average If the closing price is less than the low calculated as the current bar minus the bar which the latest order was 48 Variables of Position Following These variables give more precise information on the state variables They will tell you whether you have positions currently and if so how many The three variables are CountOfLongShares the count of shares in a long position 0 if not long CountOfShortSharesthe count of shares in a short position 0 if not short CountOfPosition the count of accumulated positions if pyramid is allowed Figure 44 below shows an example of the use of variables The program buys 10000 shares or quantity in this case on the EURUSD spot when the price breaks out from the 20day moving average If the conditions are met then the program continues to buy up to 3 times and sells the position on a new low breakout 49 AB CMC Markets REM buy when the price breaks aut of the z day moving averag condition clase gt AVERAGE LI Hclase REM this condition is ta enter the market IF NOT OnfMarket THEN IF condi
18. e of 37 e Click on the exit short for the condition when Chande 1 is lt to a value of 37 e Check that the commission by order and the minimum commission is 0 under capital management and that the initial capital is correct e Press ok to create the program and enter a name e Enter the starting and ending date in section 3 and 4 as shown in figure 20 e Tick the box keep this window open after validation and validate the program Gackhics Creation with ProBackicsi Backtest name cae MUNERA i Bakteet piror rti orti Jreert fun cpan Pr ce eL ERL Lee nrz aar L arrhes 2 doe l idea we 27 0 IF C1 THEN BELLSHGRT 100000 SHORES AT MARKET THEORIE ENTF Inddatere e Chande aa 4 mdicaiurz e 27 CH IF CC THEN EXITSHORT uTPARKET THIEBARCPALLCISE ENDIF R Duct eai diegia pri Sey Mergent Capra aa EA Ukgrmrabuun ai 3 Starting date Does PSE Gate sd di e tom Har p Enant date Ln Tat data arable amp x Haretest Motes the uid nage beens gies diea d km IHA mawe heed thi NA nora ner after valldstien uailse mp an Figure 20 program for our backtest with defined properties Figures 21 24 show the results that are produced We will optimize our program using different parameters from here You can enter dates here using the arrow and mi Es v s UE eros You can make notes to your self 1n this section as done here 27 KIBS NM fraa S
19. ent 3 Code Generation e Press ok to create the program The program is created as seen in figure 6 This line is a note to yourself you can write anything after REM and it will be ignored a You can name the indicator anything with the condition lt 35 End the program e Enter a name for this backtest its best to tick the box to keep the window open at the Defines our indicator RSI based on EM BLY the closing price of 14days indicatart lial C1 indicator 35 0 IF c1 THEM BUY 100000 SHARES AT MARKET THISBARONCLOSE ENDIF REM Gel If condition is met then buy the quantity on the close of the bar at market price Indicatarz RSI 14 clase c2 ndicator2 55 0 IF C2 THEN SELL AT MARKET THISBARORCLOSE ENDIF Figure 6 the assisted creation generates our code bottom before validating the program Tip you always need to enter a name for the backtest else it will produce an error stating to enter a name A detailed reported will be produced with 3 tabs as displayed below in figure 7 The below default statistics tab shows the overall strategy produced 2 trades of which both were profitable Oplaag Report RSE raampie Mee PIERII ESL Todal Fart Prot Dm LE i Gace Proft 59131 OQ 9129100 Dn cet Le Dix DI 0 00 PenTE Factor EI DO ER TOS amber H rees 3 D Barei Hitt i OD LECHE PG na Vere gg Trades t E Lag ISSE D Ee Trades Pig Trada Tat Daft a re
20. etailed statistics report from the backtest 22 Detailed Report MACH LUS 4 T Er Fx a i IET E ic ee 5 net use Commun lier 2008 Cat 1 H 20 Mar S006 Bun Enta 14 Mar 2008 Sel Ent iwar 2006 Buy Erter u Feb zoos Sel Eet 3 Feb SONG Guy Enter L Feb S el Ert 17 Aan Ee Buy res t xen ence Sell iuit de AG Ber Entry ta oet eS Se iu D URB Ente an 5en zm Sell iut 21 Sen LRS fErmer Fa Bep ames Seb st Agen 4 Aug en Bur Enter inen 1i Ju 2065 Sat Enit 10513 25 42 2005 Bun Enter apis 15 Xn rp Seb isti ina tAn romai Enter igya 38 Aer 2O08 Sel Ent 10197 26 ar CD u Ente 20047 27 Apr zt sel Eat 10184 14 ap 200060 Enter 10750 7 Ant 2005 ol Exit sas 10 Mar 2005 au Ente H 25 Feb 2005 58 iet we ei Feb 2005 Hin Enter l Wied Manc gadet Ge Figure 16 the 28 orders for this backtest 23 ni p Kres Detailed Heport MACD LIS3U isl Entry Paim T Eur Date Typa Bar Mh Abs Purl feat Perf lC mEes 31 d i MMT amm LS Act 2UDO Long LN LU A 1 sr 2006 LNS 2008 Long u sas U gt reh E g Feb 2008 Long 4 E 1 LT Jan 2008 1 Feb 2006 Long ti 1053 1 2 Dec dnos 6 Jan 2005 Long a gs 1 a Dct TR B DCL 2008 Long Ls a5 ti 20 Sep cmm 20 sep XB Long H zH 1 dag 2005 6 Sep 2006 Long Ri PS zin aes DS long E ap U Tinan 15 Jun 2008 Long h ES i zd pru 2B Aor 2005 Long 1 EN 1 14 opr 2005 27 don 2005 Long a 360 A In Mar as Aer
21. gy 50 E Ar pah AL EC M B PIS lt 9 Lara Tate GL Trader Tot Net Bat OOO O Sa a on Eres Penit 3041 00 ES Re pon rare Loss Em Gues DO an m e ze E Dahi Factor nos DIS nia Tots Rate of Trades Parant Profkabis Hra Tracer Larg Trades Eyer Trace Ayr Trade Net Prol Aus Winning Trade AigLodra Tae Biel Desistir al Trace bont Langart inning Trace Largest boing Trade EE EC Avg Bars Boeitweon Trines nN Dain Moning Teges O i Z 0 0 0 0 0 1772 _ Aya Bys in Lara Traces DU Pars HSS Tat Percent of Time in the Matal Lo ee Ce Mat Cresc Warning Te Maz Tormeouitive Loding Traces S ee T Men per rtg FUTT Up etm e Hra capta Moi Bekle Figure 45 shows the detailed report statistics 51 het nite Hepes LUE IS TE F CS F oe 3n ir amie Sal Est 29 hug 2005 Buy Etter B arg 2005 ell Ei 31 1d S005 Buy Enter 29 Tu zr By enter 20 Jd 2005 Buy Enter 7 2005 Sail cet 20 14 2005 Buy Enter 18 1d 2005 Bo Enter 1B Jud 205 Buy tnter 17 14d 200 sel ret 14 Jul 2005 Bay Enter LS zmaipus tenter 19 dd SUS Bus Enter 28 Jun ons Ssh CE 28 lun A005 Bur Enter 20 Juri 2005 Gell ES 19 lin 2005 Buy Ente 28 Apr 2005 Gell Eat 18 Aex 2005 Bay Enter 18 Aer 2008 Buy Enter Lier 2005 Buy Enter 13 Ar 2005155120 12er UR Buy Enter seMorzu sali 17 Feb 2005 Buy Enter da TER 2005 Buy Enter TS Feb 20S Buy Enter Figure 46 above is the orders list where the
22. he last executed orders Stop loss programming You can add four different types of stops as seen in the assisted creation on pages 13 and 14 The function SET STOP price allows you to create a customized stop An example of this is shown in figure 50 Translation of program If the closing price is greater the moving average based on the closing price of 20 days and you have no positions then buy 10000 shares at market price You can create you own names to these as long as they are REM a following STOP IF close AVERAGE RO AND NOT OnMarket THEN BLY 10000 Shares AT MARKET REM calculate the difference between ideal price and real price Spread openOtlextBar low REM initialize the highest price since the market execution referenced the same Up openOfNextBar throughout the ENDIF program REM updates the stop to let te distance ta the hightest price constant MAX eu the ebe IFOnMarket THEN MA Mae Keg Rio Up MAX Up high SET STOP Up Spread ENDIF Figure 50 showing an example program of a stop Test Yourself Lets end with a test looking at a UK pharmaceutical stock Glaxo Smith Kline GSK daily chart for a year We want to create a backtest by programming using the Average True Range ATR so that we buy or sellshort when there is a panic in the market ATR is simply a moving average of true range calculated over a number of days True Range and Average True Range are common volatility measu
23. hori Trada Total Het Prot E nos AITE Gees Frott PAF 2487 23 Grat Lari Du Do S L ns TH hna cf Tada Ferrant Protteble rea Tradat Ling Tradar EE CAE a BL LT a HRD inn Trade 248508 bp Long Trade p stri Deviation of Trade Poe 275 09 Largest fining Trade ME Cp Loge Leg Trada DO Bg Bark ry Tracks Leon SA NER E SEN GIAA Tajai I0 H Bate iri Ler Daer D ig Rats PER Trades DD Pertert oF Time n the Marhet ILH Total Commiesan Mz Comecuine Winning Tradar Mus CS Las Trad Roger err Mai Epub run ue esum on FUE canat Maf Bechter Goss Figure 21 detailed statistics report 28 A i Tee ege a abc um Ek TAUL lites EE se Les zs jor IIa giad Depu cabe Dutel STE TY 4 Maw 2006 Sel Enter A Mas 2006 Buy Exil Lee 3EDEZ IRS JHH 25 587 2005 Bu an Late 52057 179 Op zi 15 Aug 2005 Sel Enter 1 7965 33057 Aen apen 12 Maw AEB Buy Exit L aea 53745 luris il H 20 ipt CE Seb enter Lg 5ar45 101 2512 34 ger S008 Boy Ean Lasz 5 81H SHES 3672 Tl Mar arpzel Enter Laser 51918 99 25719 Mah Rar kitez Clin Figure 22 orders list for the backtest 29 Delalled Report cable Kor ate 4 May 2008 Short 1395 7422 32 Mui GEIER Chott 002 Sap 32 Mer 2005 Short 009906 ModheBacktest m Figure 23 the four trades with their direction dq 3311 OC d e 30 abe E BRS E ayer v Daily M Add Indicator i 500
24. ina Tishu nig Lorna Theda Eid Destin of Trado Graft Last YTO Trag aetna Teas Se Beis Tries 4x Bars lezes Tr aka Kg Baz H TEM Traces Ag Eeri in Loan Trocies amp vg Herz ni En eke percer OF Time p the Waler SC aet Tria Commis Hu Mar COPRBCUONV Wri Tras a fas Coreeculue Log Trades D Vera ren EE War ett ng up 149101 i 0 00 Rater on rici canta Ce 3 DC Modify Bache s TEE Figure 7 detailed report of our backtest showing the overall statistics Note The return on capital will not be displayed correctly due to margin trading not being taken into account However the net profit will continue to change real time if positions are open The orders list tab displayed in figure 8 shows our 4 trades being entered with our total equity changing as we enter and exit trades Although we are investing 100 000 and using 100 of capital on our trades the system only buys 20 as 100 000 4826 20 which is equal to 20usd pt as the system is in US Dollars The current value just refers to the quantity times the price e g 4826 x 20 96520 which is the contract value Alternatively we can view this 9 return as 900 because we only have to use 1 as margin on indices at CMC Markets based upon investing all our capital 10 t BuySell Price Current Value Commission 18 Nov 2005 Sell Exit 5503 104557 13 Oct 2005 Buy Enter 5254 ms 99826 14 Jun 2005 Sell Exit 100920 18 Apr 2005 Buy Enter 9652
25. le 19 Lets create a MACD indicator on the US30 cash chart gt Right click US30 cash in the tree or a single group price window to display the chart and change the time frame to 1 year daily on the toolbar gt Then click add indicator and double click on MACD on the left under the indicator tab gt Click close on the properties window that appears we will use the standard defaults You will now have a chart with an indicator like figure 13 seen below YA S20 Indes EE EA Bid Chart A On amp EI IR 1 Year M Daily M ru Patz is real time Dec vf 4 Gi Figure 13 US30 chart with an MACD indicator e To create the backtest on this chart simply click add indicator then click on the backtest tab create backtest e Click on the assisted creation tab e Click on buy and then MACD on the chart e hen define the conditions so that we buy when MACD 1 blue line crosses under signal 1 red line with a quantity of 100 000 then click OK e Click on the sell for the condition when MACD 1 crosses over signal 1 20 e Click on the capital management button Our initial capital of 100 000 should already be defined In this case set the commission by order and the minimum commission to 0 e Press ok to create the program Figure 14 shows the program that is produced MACD 1 indicator with REM Buy WA properties defined Indicatori MACDlinep12 26 9 el0se Indicator Exponential amp verage 2 MACDline 12 26 8 relosey
26. led statistics report showing a healthy 28 return 60 74 5 80 0086 1431 82 12 439 Bele Short Trades 1588 88 1237 18 687 99 93 67 17 78 00 108 E njal TE 52 12 3 1668 02 2663 07 15 8990 43 Ls UKA00 Indes CAO Bid Chart KR l SS ahe T xZ lt 4 5 Years bd Daily Add Indicator Long positions Short positions 46 o Figure 40 chart showing our backtest Test yourself Try and create a similar program yourself on the same 5year daily UK100 chart so that we go long in month 10 sell out month 1 then go long again in month 2 and close out in month 5 We will invest 100 of our capital Turn over and look at figure 40 if you struggle figure 41 gives the results of this strategy 44 REM go lang in month 10 and sellin month in month 5 IF Month 10 THEM BUY LOO capital AT MARKET ELSIF Month 1 THEN SELL AT MARKET ENDIF IF Month 2 THEN BUY LOO capital AT MARKET ELSIF Month 5 THEN SELL AT MARKET ENDIF Figure 40 program showing 2 longs from Oct to Jan and then Feb to May i and then again in Month 2 sell Translation of program If its Oct then buy 10046 of our capital at market price else if it s Jan then sell at market price If it s Feb then buy 100 of our capital at market price else if its May then sell at market price 45 Profit Factor Total kumpes of Tak Percent S B Tahar Avg Trade Met Prof Ge Winning Trade
27. lose of the current bar Hour Hour of the close of the current bar Day Day of the close of the current bar Month Month of the close of the current bar Year Year of the close of the current bar DayOfWeek Day of Week of the close of the current bar where Monday 1 Tuesday 2 etc 40 An example of the use of time frames is given in figure 38 MIN MAX This mathematic function will return the lowest and the highest of two elements you need to use the below convention An example of its use is given in figure 50 MIN a b where a and D are two defined conditions or quantities e g MAX a b MAX open close Control Structures A control structure can be created using the below commands where you can extend or simplify the else elsif conditions as you require a simple example is given in figure 37 IF test THEN Instructions 1 ELSIF test2 THEN Instructions 2 ELSE Instructions 3 ENDIF Translation of program REM use of a simpie central structure If the close is greater than the close of a 30 period weighted IF clase gt Weightedaverage 3t close THEM pibe ee Then b 10000 sh t BUY 10000 Shares AT MARKET e Ki shares d End of the market price program gt ENDIF Figure 37 example of the use of a simple control structure 4 Lets look at another example Many traders know through historical data that markets tend to rise around October till late April and then fall from May till September Lets
28. mulation of the position CCS K 1 Be N XA Ma lt Daily D Add Indicator 101000 C TLEinance corm Dafa is real time 1 i t T mam 1290410000 A N Ud T ow E 1 1 3023 10000 11 28 111 3011 10000 x Un ad j Figure 48 the EURUSD chart showing our backtest results Bars Access Relative to the Last Executed Order There are two types of commands Entrylndex which is the index of the bar on which the latest order was executed and EntryQuote gives the price of the last order Another commonly used command is Barlndex which is the index of the current bar in the chart from 0 An example is provided below in figure 49 54 REM buy on a moving average breakout IF NOT OrnMlarket THEM IF close Exponentialdverage 20 iclose THEN BUY 10000 Shares AT MARKET EMDIF EMDIF REM exit under the lowest orice of the candlestick ent You could use EntryQuote IF OnMarket THEN here e g to exit under the market price SELL AT SELL AT low BarIndex EntryIndex STOP EntryQuote STOP EMDIF Translation of program If there are no positions then if the closing price is greater than the 20 day exponential moving average calculated based on the closing price then buy 10000 shares at market price If there is an open position then stop sell at the low given by the current bar minus the last order bar Figure 49 an example of the use of bar access relative to t
29. ofit 9293 2 8283 a Profit Factor s ua hia Total Number af Trades Percent Profitable SS a 0 Winning Trades E losing Trades 0 0 D Even Trades 1 R Avg Losing Trade Std Deviation of Trade Profit 3109 89 Largest Winning Trade 3109 om D s Largest Losing Trada 0 00 0 00 000 Avg Bars in Trades Gel ue 2195 Avo Bars Beetween Trades 52 33 ni 52 33 Avg Bars in Winning Trades 23 M Wl es 23 57 Avg Bars in Losing Trades nal na pA Avg Bars in Even Trades om nja D 00 31 14 Percent of Time in the Gen 31 1498 Mag SE EE Trades 0 00 3357 90 Max draw down 3387 90 Max equity run up 8346 21 0 00 6346 20 Des 8289 Return on initial capital 8 28 Modify Backtest Close Figure 27 optimization statistics shown in the detailed report 33 butzeg Curent Vale Curmisan 4 May 2005 cel Entrer Leo Ge 4 May 2DOG Bu Exit 7 Le BES 25 Sao 20 EB Eat dl E 11 Ag 2005 Sel Enter lU0B1Dd DE 12 Mey 2005 Boy xit Edz45 100116 Iara ZU Apr 200 561 center JDSTO 7612 au Mar ln ct i Se ee _ 11 si ares pin Enter re Bates Figure 28 optimization orders list 34 Detailed Hepnrt calli au Oman ET Cigts Type 4 Bay xix hort 1i ai 25 Sep S008 S Si Zeil anan se 12 MBy 2005 en 20035028 me Y Mar 2568 3B Mar 2005 Short H auae sonar Wat Backtest Ces Figure 29 optimization trades list with directi
30. on From the optimisation we still have the same number of trades as four However our third trade was executed at a better price to short on 11 Aug at 1 8102 rather than 10 Aug at 1 7966 which in turn has increased our profits from a return of 7 5 to 8 28 The optimisation report in figure 30 shows us our profits at different optimisation parameter points that we defined earlier between 32 to 40 in order of the most profitable condition 35 uu Optimize Re Report PUE Net Profits f Return on Capit Return an Canit Max Draw Dow Draw Cow Nborders Ne Orders E Winning Tra Expectation ZE number 8283 01 48 28 3387 90 4 75 00 7497 21 7 50 3413 48 75 00 7497 21 47 50 3413 48 75009 7 40 7395 54 7 40 7396 64 7 40 10 7396 64 7 4095 5 02 3285 70 3 66 567 R 5017 98 5 02 3285 70 66 67 m lij E 1 9 166 7155799 1 7865 53002 IN LT hr L den Ta N Mar Apr May Aug Le 1 a Figure 31 chart displaying the optimized backtest 36 CREATION BY PROGRAMMING ProRealTime provide some modules and manuals to assist you in creating backtests You can access this from either www prorealtime com en or by clicking the ProBacktestHelp as seen in figure 20 This following section uses some of the information provided from prorealtime and simplifies it Having gone through the assisted creation this section should be easier to unde
31. or 3 07 10 Total Number of Trades Percent Profitable Winning Trades Lasing Trades Even Trades 50 00 Aug Losing Trade Std Deviation of Trade Profit Largest Winning Trade Largest Lasing Trade Avg Bars in Trades Avg Bars Beetween Trades Avg Bars in Winning Trades Avg Bars in Losing Trades Avg Bars in Even Trades Percent of Time in the Market Avg Trade Net Profit 1664 53 Avg Winning g Trade 4941 15 IUE a s pn 10056 50 29069 50 30018 50 ital EE SE 0 460 Max Consecutive Losing Trades Max draw down 10917 50 Max equity ruin UD Return on initial capital Modify Backtest Close Long Trades 17101 50 Gross Profit zu 22404 00 Gross Loss DU DU 5304 50 4 23 GO SIG 3420 30 7468 00 2651 25 6507 03 15120 00 2118 en 58 90 11 00 66 33 47 50 Figure 58 the optimised detailed report statistics SEE Short Trades 450 23 2301 75 1150 88 919 33 1081 22 1518 75 1421 o0 22 60 1100 43 50 8 67 Dia 90 2795 0 00 GE 8719 50 63 Dpialzegd Ripari Gas gp lised takt i v tele oe T a f Bun tet Ti Way EDS Sed Enter Ire Oe a Enter 33 Jar 2905 el Enter 29 an 205 B Enter aN O05 ed Enteri cet DD R Eater 21 Oct A105 Sel rier B Apr iilo Enter E Ma 2005 Sed Enter zz reb XD BN Ipnter Pre Has 1492 75 KE 1488 00 1497 00 m DHL HALI 1583 0 1554 75
32. quantities can also be seen to be accumulating 122271 HUD 12736 En WD 10000 120 TODO0 ize DOCD 2000 En OPO LTR IOD iomo 12217 0000 iomo 12057 Don iamo 17 0000 HDH ee soan ID 12212 0000 innon 12797 omn 000 38775 0000 10000 1911 Op 10000 12919 0000 t0000 1291D D00D joe Lxx mn ml emm om OOD in 15 000 an iaioo wom i297p 918 22 Detailed Report EURUSD mi MF XT E mU Pe e lm a e es U entry ban ti Ext tate D e gent Dot common ES z May BONS zH Ms 25 May ole 13 Apr 2905 Lorg Apr Se irr 2n Mar S06 bor 14 Mar ZU e Mar e006 Lory 1 fat 2005 D Mar 200s Lang 1 Feb 2 2 Feb gl 4 Fan 2005 23 Tan ADS Log 25 Duc TUS 36 Dac S lfsiLen 0 pem z D pec 21 e Der enuiLorg zp OI 2 Bec asla 27 Nov XS 28 Now SOS borg 25 Oct og 21 CKY E 23 Oct Log 46 L 2005 jg cct edosiLang Si 235 11 Ce Steg L an XE Lenze en Aug eam 31 aug EU erer 23 d aus Li dug auus La 19 H zoe 2 M Ste DA H rg 28 lin Se 20 n SISIL 18 Jin zm zu Mun zsiLang 17 Apr apri SE Tab e131 EET n isa DDA LEH SG na O e N N RO aso Daig SAU S281 anm oC 000 OAA i12090 ORN 36 0000 gai ET 429 0000 2x8 Dnan 464 DIOH TL 9900 73 0000 Enn 254 0000 55 9900 35 0000 ET het k amp ee mili ls Bu ba ut ler mr em ai fa Moly Sale Case Figure 47 the backtest trades list all the positions were long 53 Shows the accu
33. rements The larger the True Range the greater the volatility of the stock Conditions for long positions We want to buy at market price investing all our capital when the closing price of GSK is greater than the previous days close the AVT based on the closing price of 30days Conditions for short positions We want to sellshort at market price investing a third of our capital when the closing price of GSK is less than the previous days close the AVT based on the closing price of 30days 56 Then optimize the program to find the optimum AVT value testing from 20 40days with increments of 1 Turn the page to view figures 51 61 for help and the results Note We will always hold a position as it will reverse itself We are using only a third of our capital on shorts as with short positions the potential loss in unlimited REM Strong increase in prices panic Guy hence buy Wher IF clase clase 1 Average TrueRange 30 claseY THEN BUY LOO Capital AT MARKET ENDIF REM stroma decrease of prices panic selling hence sell wher IF clase clase 1 Average TrueRange su iclose THEN SELLSHOGRT Ss Capital AT MARKET ENDIF Figure 51 the code required to generate this program Translation of program If the close is greater than the previous days close the AVT based on the 30day closing price then buy 100 of the capital at market price If the close is less than 57 Detailed Report GSK All Tr
34. rstand Order Definition As in the assisted creation we define our conditions for our order Long positions BUY count SHARES AT MARKET AT price LIMIT AT price STOP A long position will be opened using this command If you were already short prior to this the short will be closed and the position bought would put you long by the count of shares stated If you were already long prior to this execution then this command would depend on conditions stated within capital management SELL count SHARES AT MARKET AT price LIMIT AT price STOP Long positions will be sold using this command If the positions are flat or short then nothing will happen If the backtest is long the count shares are sold if the number is greater than the long position then the position does not go short if no count is used all the position is sold Short positions SELLSHORT count SHARES AT MARKET AT price LIMIT AT price STOP This command opens a short position If the position is already long then it is reversed to be short by the count If you were already short prior to this execution then this command would depend on conditions stated within capital management 37 EXITSHORT count SHARES AT MARKET AT price LIMIT AT price STOP A short position is closed with this command If the position is flat or long then nothing happens If the position is short then the count shares are bought if count was greater than the short positions
35. see what happens if we short UK100 in May and buy in October investing 60 of our capital over five years Figure 38 shows the program used in this example on the 5 year daily chart REM Gell chbort in May IF Month 5 THEM SELLSHORT 60 Capital AT MARKET REM Buy to close In Octoatier ELSIF Month 10 THEN Bury O0 9S6 Capital AT MARKET ENDIF Translation of program If the month is May then go short 60 of the available capital at market price Else if the month is October then buy 60 of the capital at market price Figure 38 program used to sell short in May and go long in October From figures 39 and 40 it can be seen that this is a good strategy 42 Detailed Report UK 100 Al Trades Total Net Profit 2832 11 Gross Profit 4036 67 Gross Loss 1204 55 Long Trades 1243 24 1264 05 20 81 204 55 Profit Factor Total Number of Trades 11 Percent Profitable m Winning Trades Losing Trades Even Trades Avg Trade Net Profit Avg Winning Trade Avg Losing Trade Std Deviation of Trade Profit Largest Winning Trade Largest Losing Trade Avg Bars in Trades Avg Bars Beetween Trades Avg Bars in Winning Trades Avg Bars in Losing Trades 120 00 Avg Bars in Even Trades Percent of Time in the Market Max Consecutive Winning Trades Max Consecutive Losing Trades Max draw down Max equity run up Return arr initial capital Modify Backtest dose Figure 39 Detai
36. so pie Set To hedefinmi Ciddi En define Te sae of rr past Soot Ta bedefined Gordons co ire short positions Eurtent kr pittore wi bis abo zk Ext en Tobe defined Codice Ln deie the pue of tice pnie 2 ley Marnm canita Management ETS 3 Code Generation Figure 2 options to create a backtest For simplicity in this example we will use the assisted creation We will create a long strategy to buy when the RSI is lt below or equal to 35 and sell the position once RSI is gt above or equal to 65 e To enter the condition to go long click on buy the assisted creation will prompt you to click on the chart as seen in figure 3 Assisted Backtest Creation Add a Condition Click ona chart to create a condition Buy 1 0 units stocks lots Current period close o Delete Cancel Figure 3 defining an order in assisted creation e Click on the RSI indicator on the chart as we are defining conditions related to this e hen define the conditions so that we buy when RSI is lt to a value of 35 with a quantity of 100 000 then click OK as shown in figure 4 below Assisted Backtest Creation Add a Condition value si 35 Delete Condition Bury 100000 units stocks lots e Current period close OK Delete Cancel Figure 4 a defined order condition to enter a long position e Click on the sell and define the RSI to be gt value of 65 and OK the box
37. sword Change Chat Alert Chart Options Gil Value Boxes 3 Switch to Cursor Mode after each Drawing Drawing Assistance 1 Contextual Help L Display Objects Figure 11 how to enable value boxes in Marketmaker E i4 pst Us Dollar vs Japanese Yen Bid hart i de ETIN Figure 12 an example of a value box of USDJPY on 20 Mar 06 Creating a Short Position on a Backtest 14 Order Definition You can also enter shorts in the order definition of the assisted creation where you must define the exit of the short to close the position Once you have your chart with your indicator e Click add indicator then click on the backtest tab create backtest e Click on assisted creation tab e To enter the condition to go short click on short the assisted creation will prompt you to click on the chart e Define your shorting criteria and click ok e Then click on exit short and as above define your criteria from the chart Advanced Refining your Backtest Capital Management Below is a breakdown of what the capital management window shown in figure 11 represents 15 Mark Capital Managemeni a leet lil capitals DOC Dy Lrrmpmzcht In order Rm raman Minimal Corrmiosion 5 Re E See ciiin rent Masama total comnitiment ium Ban Cage baal Maximal commitment by trangackiors LOC Ba amba e rnd courtier by Ir am sluur C To v Capital Promises amari aegreresr rt a Irtvarzk pror
38. t including commission e Tick activate this stop and choose the percentage or points for execution including on which bar to activate Profit Stop This stop closes a position when a profit reaches a specific value or percentage commission included e Tick activate this stop and choose the percentage or points for activation along with when Trailing stop This stops closes a position when a specific value or percentage of profit was lost compared to the maximum potential profit reached since the beginning of the position commission included e Tick activate this stop and choose the percentage or points for profit decrease along with when 18 Inactivity Stop This stop closes a position if for a given period price did not move in a profitable way of a given percentage e Tick activate this stop and choose the percentage or points for activation along with when and include the period Test Yourself Try to create a US30 chart displayed for one year based on a daily time frame with an MACD indicator not the simplified MACD Conditions for long positions For our backtest we want to create only long positions so that we buy when MACD 1 blue line crosses under signal 1 red line and sell when MACD 1 crosses over signal 1 Conditions for capital management Enter the initial capital as 100 000 where we reinvest all the profits with no commissions on our trades we don t want any stops either Turn the page if you strugg
39. ting the capital management conditions to suit your criteria ASSISTED CREATION This section covers creating a backtest using the assisted creation which helps us create a backtest using wizards Example Lets create a RSI relative strength index indicator on the UK100 cash chart e Right click UK100 cash in the tree or a single group price window to display the chart and change the time frame to 1 year daily on the toolbar e Then click add indicator under the indicator tab a single click left on RSI will give us a description on the right about the indicator and how its calculated but you need to double click on RSI to create the indicator e Click close on the properties window that appears we will use the standard defaults You will now have a chart with an indicator as seen in figure 1 below Et UK Indes Gash Bet Bid Chart rm 1 Year Daily T IR Am Ju Aug Sep Oct Nom Dec 2006 reb Mar Apr PI eisen Figure 1 UK100 chart with an RSI indicator The Three Stages to a Backtest 1 Order Definition e To create the backtest on this chart simply click add indicator then click on the backtest tab create backtest Here you are presented with two options either to create a backtest using the assisted creation or by programming e Click on the assisted creation tab as seen below in figure 2 E eh T iieri chefawt inn DA To bevietined Conditions tn define slong posbon Cument short preira wal ba al
40. tion THEM BUY 10000 Shares AT MARKET ENDIF EMDIF REM if the buy condition iE true pyramid the position 3 times IF OnMarket THEM REM condition 2 ls given By a nene low breakout condition clase lt LOWEST 15 dow ii REM the exit depends on a double condition IF NOT condition or condition THEN SELL CountOtLongshnares Shares AT MARKET REM pyramids 3 times while the exit condition is false ELSIF CountOtPasition 3 THEM Bur 10000 Shares AT MARKET ENDIF ENDIF Figure 44 use of variables example on EURUSD Translation of program Condition is the closing price has to be greater than the 20 day moving average based on closing price If there are no positions then if condition is met buy 10000 at market price If there is a position then condition2 is when the closing price is less than the lowest calculated moving low price of the indicator where we refer to I5bars on indicator Lowest count bars indicator If neither condition is being met then sell all the shares at market Else if the position is less than 3 then buy 10000 at market price The use of pyramids is only permitted if the option accumulate positions is ticked in the capital management window as seen in figure 5 under the section positions management Also if you use 1 stop for all positions then all positions will be merged into one so the count cannot be greater than one Figures 45 48 show our results as not a profitable strate
Download Pdf Manuals
Related Search
Related Contents
酒米水分計ライスタf4 取扱説明書 Rev.0201 Bombes de table (V12) MIRACLE FIRE BALL Philips Portable DVD Player PET1035 PLレポート 2009年度 No.11 EQFB0012 安装指南 FosBaby系列 LOGO 快速安装 OM, 455 e Rancher, 455 Rancher, 460 Rancher Manual de utilização (versão pdf > 500 Ko) Copyright © All rights reserved.
Failed to retrieve file