Scalper Machine V1 Dax
Forums › ProRealTime English forum › ProOrder support › Scalper Machine V1 Dax
- This topic has 22 replies, 14 voices, and was last updated 4 years ago by
VinzentVega.
-
-
01/04/2017 at 9:37 AM #19779
I would like to show you my first attempt to create a system.It is a Scalp system for Timeframe 1 hr Dax ,Take Profit 4 pips and Trailing Stop 12 pips. The System start in 8 30 pm Time Zone GMT+1 and stop 17 00, Spread is 1 point .It has become backtest from 2012 and the results the see above.
Any feedback and any suggestions are welcome!Enjoy it!123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130//-------------------------------------------------------------------------// Main code : A Scalper Machine V1 dax//-------------------------------------------------------------------------//-------------------------------------------------------------------------// A SCALPER MACHINE V1//-------------------------------------------------------------------------// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedREM All positions will be not open before this timedefparam flatbefore = 080000REM All positions will be closed after this timedefparam flatafter = 165000// MONEY MANAGMENTQTY=1ONCE M=500BANK=100ONCE PQTYADJUST=0QTYADJUST = ROUND(STRATEGYPROFIT /M)IF QTYADJUST > 0 THENQTY=QTY+QTYADJUSTIF QTYADJUST < PQTYADJUST THENM=M+BANKPQTYADJUST=QTYADJUSTENDIFIF QTYADJUST > PQTYADJUST THENPQTYADJUST=QTYADJUSTENDIFELSEQTY=1ENDIF// VARIABLE.. FOR EASY BACKTESTING ////////a=55b=2n=2z=7v=23q=2a1=12b1=1k=15w=2ts1=9ema = Exponentialaverage[ts1](close)advance=abs(round(ema-ema[1]))/////////////////////////////////////////////////////////////////////////////////////////// TIME AND DAY MANAGMENT// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// trading windowONCE startTime = 083000ONCE endTime = 170000// trade only in trading window 9-20IF Time >= startTime AND Time <= endTime THEN// MAIN SYSTEM //// Conditions to enter long positionsindicator1 = Average[n](close)indicator2 = Average[z](close)c1 = (indicator1 > indicator2)indicator3 = Stochastic[a,b](close)indicator4 = Average[v](Stochastic[a,b](close))c2 = (indicator3 > indicator4)indicator5 = MACDline[12,26,9](close)indicator6 = ExponentialAverage[q](MACDline[12,26,9](close))c3 = (indicator5 > indicator6)// Conditions to enter short positionsindicator9 = Average[a1](close)indicator10 = Average[b1](close)c5 = (indicator9 > indicator10)indicator11 = Average[k](Stochastic[a,b](close))indicator12 = Stochastic[a,b](close)c6 = (indicator11 > indicator12)indicator13 = ExponentialAverage[w](MACDline[12,26,9](close))indicator14 = MACDline[12,26,9](close)c7 = (indicator13 > indicator14)// LONGif not longonmarket and c1 AND c2 AND c3 and Momentum[11](close)>0 and RSI[6](close)>65 and not daysForbiddenEntry thenBuyPrice = ema+advancebuy qty contract at BuyPrice limitendif// SHORTif not shortonmarket and c5 AND c6 AND c7 and Momentum[11](close)<0 and RSI[6](close)<35 and not daysForbiddenEntry thenSellPrice = ema-advancesellshort qty contract at sellprice limitENDIFset stop pTRAILING 12set target Pprofit 4endif01/04/2017 at 9:43 AM #19784Hi Antonios, I moved your post from the library pending queue to the forum.
Unfortunately, you have been trapped into the “0 bar phenomena” which is a well-known and common problem of Probacktest result before the version 10.3 of prorealtime. If the stoploss and takeprofit price levels are met within the same bar, the takeprofit is tested first and your trade is a winning one, but it would not be the case in real time trading.
I see that you have optimized a lot, all indicators periods, which is not good, the result is over-fitted on the past data.
So, I’m sorry but the backtest is not good here. Please don’t be offend, we are all here to help each other 🙂 Your questions are welcome.
4 users thanked author for this post.
02/04/2017 at 6:48 PM #2392802/04/2017 at 7:44 PM #23938I get this result with 10.3 tick by tick. Still look too good to be true.
Nicolas- Is this the same backtest problem that we have in the backtest in Rauls 5 min intraday thread?
02/04/2017 at 8:17 PM #2394202/05/2017 at 9:51 PM #2401502/05/2017 at 11:07 PM #24017Thank you Antonios for this interesting code.
Ratio is very good and I like when you are few time in market. Let’s have a look if tick by tick backtest and demo mode have same results…
About optimization: backtests are still good when I modify a little bit variables.
Growth of the contracts number if perhaps too much exponantial for me.
Could you just tell us how did you find this strategy?
02/06/2017 at 9:10 AM #2404002/06/2017 at 10:11 AM #2405302/06/2017 at 9:57 PM #2416302/08/2017 at 2:57 PM #24348Hello Traders!
I would like to forgive me for not so good English but is don’t my native language.
I want once again to thank you all for feedback to my system,and and especially the Alex ,the algorithm gave me the idea for my system.This new version is for 2HR ,1 point spread , trading hours 09:00-19:00 GMT+1,Initial capital is 200 $ ,Risk= 2,and Dax 1Mini.
Trailling Stop 65 and Take Profit 12.The results are from 2012 tick by tick,and he wants is the attention to DD in the Risk=2.
Enjoy that.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147////////////SCALPING MACHINE V3.1////////////////////////////////////////////defparam cumulateorders=falsedefparam preloadbars=1000//defparam flatbefore = 080000REM All positions will be closed after this time//defparam flatafter = 203000////////// MONEY MANAGMENT//////////////////////////////////////////////////equity = Capital + StrategyProfitmaxrisk = round(equity*(Risk/100))PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)Capital = 200Risk = 1.7StopLoss = round(margin*2)margin = rangepips*rangepercentrangepercent =0.1REM NIGHT MAXmaximo = dhigh(0)REM NIGHT MINminimo = dlow(0)REM RANGE IN PIPS BETWEEN NIGHT MAX AND MINrangepips = round(maximo-minimo)/////////////////VARIAMBLES/////////////////////////////////////////////////ts1=9ema = Exponentialaverage[ts1](close)once uma=Highest[ts1](high)once umb=Lowest[ts1](low)Wave=39*pipsizea=11b=13n=13z=4v=12q=26a1=9b1=9k=1////////////////////TIME MANAGMENT//////////////////////////////////////////ONCE startTime = 090000ONCE endTime = 190000IF Time >= startTime AND Time <= endTime THEN/////////////////////////////////////////////////////////////////////////////////CONDITIONS TO ENTER LONG&SHORT ///////////////////////////////////////LONG/////////////////////////////////////////////indicator1 = Average[a](close)indicator2 = Average[b](close)c1 = (indicator1 > indicator2)indicator3 = Stochastic[n,z](close)indicator4 = Average[a](Stochastic[n,z](close))c2 = (indicator3 > indicator4)indicator5 = MACDline[v,q,a1](close)indicator6 = ExponentialAverage[9](MACDline[v,q,a1](close))c3 = (indicator5 > indicator6)////////////SHORT//////////////////////////////////////////////////indicator9 = Average[b1](close)indicator10 = Average[k](close)c5 = (indicator9 > indicator10)indicator11 = Average[a](Stochastic[n,z](close))indicator12 = Stochastic[n,z](close)c6 = (indicator11 > indicator12)indicator13 = ExponentialAverage[9](MACDline[v,q,a1](close))indicator14 = MACDline[v,q,a1](close)c7 = (indicator13 > indicator14)/////////////////////// CONDITIONS////////////////////////////////if High > ema and Low < ema then // Touching Ema8tb = BarIndexltp = emauma = emaumb = emaendifif low>ema then // New bullish movementn = BarIndex - tbuma=Highest[n](high)umb=emaendifif high<ema then // New bearish movementm = BarIndex - tbumb=Lowest[m](low)uma=emaendifif (uma-ltp)>Wave and uma>ema then // buy conditionmyres=1endifif (uma-ltp)<=wave thenmyres=0endifif (ltp-umb)>wave and umb<ema then // short conditionmysub=-1endifif (ltp-umb)<=wave thenmysub=0endifadvance=abs(round(ema-ema[1]))//mylot=2///////////MAIN///////////////////////////////////////////////////////if not longonmarket and myres=1 and c1 and c2 and c3 and Momentum[11](close)>0 thenBuyPrice = ema+advancebuy positionsize contract at BuyPrice limitendifif not shortonmarket and mysub=-1 and c5 and c6 and c7 and Momentum[11](close)<0 thenSellPrice = ema-advancesellshort positionsize contract at sellprice limitendifendif///////////MONEY MANAGMENT////////////////////////////////////////////////////set stop ploss 76set stop pTRAILING 65set target pprofit 1202/08/2017 at 3:19 PM #2435802/20/2017 at 3:02 PM #2576002/20/2017 at 4:56 PM #25787Hi Antonios. I’m trying to backtest and understand this for myself as you have included many things which are new to me and which I would like to learn. Problem is that I am getting no trades when I run the backtest. I’m in London…all I have changed are the times to:
12ONCE startTime = 080000ONCE endTime = 180000and I’m looking at the Dax 2H. I have changed a=7.
Please can you let me know if there is anything else that I need to change. Apologies in advance if I’m missing something obvious.
02/20/2017 at 5:00 PM #25788 -
AuthorPosts
Find exclusive trading pro-tools on