Updated strategy
Forums › ProRealTime English forum › General trading discussions › Updated strategy
- This topic has 30 replies, 7 voices, and was last updated 5 years ago by GraHal.
-
-
05/30/2016 at 12:14 AM #8333
This post belongs to this system: http://www.prorealcode.com/prorealtime-trading-strategies/dax-trading-strategy-breakoutfakeout/
A few changes were made after start the strategy in real time with some troubles. Some adjuntments and improvements
Major change
Code problems mades system don’t put stop and limit orders after entering a position. Now the system runs with fixed orders “PLOSS” and “PPROFIT” to avoid this. Tested in real time and working OK.
Minor changes
- It will run from Monday to Thursday, not even Friday, Saturday or Sunday. As I suppose Fridays are more often sideways and prefered to avoid this day.
- Min distance for stoploss is now 6 pips, as far as IG broker don’t let it start with less.
- Max range was 200 points, now is 150. Max risk for this system is 0,5% of actual equity, so stoploss shouldn’t exceed 15 pips.
FULL CODE
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198//-------------------------------------------------------------------------// Main code : Binomio AutoTrading Bot v.2 DAX//-------------------------------------------------------------------------REM #########################################REM ## Binomio AutoTrading Bot 2016 DAX 1m ##REM #########################################REM Not cumulate ordersdefparam cumulateorders = falseREM No positions open before this timedefparam flatbefore = 080000REM All positions will be closed after this timedefparam flatafter = 213000REM MAX and MIN we want to operateREM No orders will be set if range is greater thanmaxrange = 150REM No orders will be set if range is shorter thanminrange = 20REM Parametersprofitvalue = 1.5 // % Range (1.5 = 150%)rangepercent = 0.1 // %Range (0.1 = 10%)REM ######################REM ## MONEY MANAGEMENT ##REM ######################Capital = 3000 // Initial capitalRisk = 0.5 // %Risk maxREM RESET MAIN VARIABLES EACH NEW DAYif Dayofweek = 5 thentrading = 0elseIf intradaybarindex = 0 thentrading = 1bullish = 0bearish = 0inrange = 0rangepips = 0enter1 = 0enter2 = 0enter3 = 0enter4 = 0abovemax = 0abovemin = 0belowmax = 0belowmin = 0//profittrend = 0profitrange = 0endifendifREM CHECK CONTROL TIMEstarttime = 075500endtime = 075900REM RANGE ESTABLISHMENTIF time >= starttime and time <= endtime thenREM NIGHT MAXmaximo = dhigh(0)REM NIGHT MINminimo = dlow(0)REM RANGE IN PIPS BETWEEN NIGHT MAX AND MINrangepips = round(maximo-minimo)REM PROFIT IN PIPS EXtakeprofit = rangepips*profitvalue// i.e we could add here "*0.9" to reduce the profit objectiveREM DISTANCE FROM LINES TO SET ORDERSmargin = rangepips*rangepercentREM SET MAX ORDER PLACESabovemax = maximo+marginbelowmax = maximo-marginREM SET MIN ORDER PLACESabovemin = minimo+marginbelowmin = minimo-marginREM SET NUMBER OF PIPS TO RISK EACH TRADEStopLoss = round(margin*2)if StopLoss<6 thenStopLoss = 6endifendifREM Calculate contractsequity = Capital + StrategyProfitmaxrisk = round(equity*(Risk/100))PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)REM SPREAD CHECKIF Time>=090000 and time<173000 thenspread = 0 // Backtest spread is set to 1elsespread = 1 // Backtest spread 1 + 1 = Real spreadendifREM CONDICION DEL MERCADOinrange = Close<maximo-margin and close>minimo+marginbullish = Close>(maximo+margin)bearish = Close<(minimo-margin)semibull = Close>maximo-margin and close<maximo+marginsemibear = close<minimo+margin and close>minimo-marginREM START SETTING ORDERSREM FIRST TRADESif not onmarket and trading = 1 and rangepips<=maxrange and rangepips>=minrange thenREM RESET VARIABLES EACH TIME WE ARE OUT OF THE MARKETif bearish thenif enter4=0 thensellshort PositionSize contract at market//belowmin limitendifif enter1=0 thenbuy PositionSize contract at abovemin+spread stopendifendifif bullish thenif enter3=0 thenbuy PositionSize contract at market//abovemax limitendifif enter2=0 thensellshort PositionSize contract at belowmax-spread stopendifendifif inrange thenif enter1=0 thenbuy PositionSize contract at abovemin limitendifif enter2=0 thensellshort PositionSize contract at belowmax limitendifif enter3=0 thenbuy PositionSize contract at abovemax+spread stopendifif enter4=0 thensellshort PositionSize contract at belowmin-spread stopendifendifif semibull thenif enter3=0 thenbuy PositionSize contract at abovemax+spread stopendifif enter2=0 thensellshort PositionSize contract at belowmax-spread stopendifendifif semibear thenif enter1=0 thenbuy PositionSize contract at abovemin+spread stopendifif enter4=0 thensellshort PositionSize contract at belowmin-spread stopendifendifendifbuytrend = tradeprice(1)>maximobuyrange = tradeprice(1)<maximoselltrend = tradeprice(1)<minimosellrange = tradeprice(1)>minimoREM SI ESTAMOS LARGOSif longonmarket thenREM IF TRADE PRICE IS ABOVE MAXif buytrend thenenter3 = 1if enter2=0 thensellshort PositionSize contract at belowmax-spread stopendifendifREM IF TRADE PRICE IS INTO DE RANGEif buyrange thenenter1 = 1if enter4=0 thensellshort PositionSize contract at belowmin-spread stopendifendifendifREM SI ESTAMOS CORTOSif shortonmarket thenREM SI HEMOS VENDIDO POR DEBAJO DEL MINIMOif selltrend thenenter4 = 1if enter1=0 thenbuy PositionSize contract at abovemin+spread stopendifendifREM SI HEMOS VENDIDO DENTRO DEL RANGOif sellrange thenenter2 = 1if enter3=0 thenbuy PositionSize contract at abovemax+spread stopendifendifendifset stop ploss stoplossset target pprofit takeprofit05/30/2016 at 8:29 AM #834305/30/2016 at 9:02 AM #834705/30/2016 at 5:37 PM #839505/30/2016 at 7:13 PM #8412Hi Adolfo, I am working with montecarlo during these days… If you send me your data I run it whit my system (very similar with nicolas system) and we can open a new thread where to disucuss how to read the montecarlo.
what do you think?
05/30/2016 at 7:52 PM #841605/31/2016 at 7:58 AM #8459please drag the last page of the result of the backtest into excel and share it here.
05/31/2016 at 8:08 AM #8461remember to put the spread in it
05/31/2016 at 8:14 AM #846205/31/2016 at 8:38 AM #8466sorry, maybe I explained wrong.
I have done it for you. this is the montecarlo test for your system on dax 1 minute with spread equal to 1. Dax 1 euro per point.
The result that you have posted where without the spreads in it. they were fake results. If you add the spread the TS does not perform good.
Comments? Am I doing something wrong?
05/31/2016 at 8:51 AM #847105/31/2016 at 9:03 AM #8475yes.. with IG I can do only 100.000 bars. Send me the list of closed position in excel.
05/31/2016 at 9:15 AM #847605/31/2016 at 9:23 AM #8481I need it full like this. just drag and drop the matrix in excel.
Nothing more…
05/31/2016 at 9:36 AM #8486 -
AuthorPosts
Find exclusive trading pro-tools on