3 Day Bull Bear
Forums › ProRealTime English forum › ProOrder support › 3 Day Bull Bear
- This topic has 5 replies, 2 voices, and was last updated 7 years ago by GraHal.
-
-
04/16/2017 at 12:38 PM #32163
*Code Attached:
160417-GH 3DayBullBear UKX 5M (v1.0)
Hello Fellow Traders
Attached – 3DayBullBear UKX 5M (v1.0)
Backtest results shown are Spreadbet (@ £1 per point) with a 2 point spread.
Please BackTest over 200K bars (I have max 100K bars) and post results on here. No / zero SellShort Trades trigger for me is this due to short conditions not met over my 100,000 bars??
Please code up improvements and post on here.
Cheers GraHal
*PS I’ll arrange (via Mods) for latest version code to be available in first post of Thread at all times (saves scrolling / reading pages to find latest improvements. Also a trial to see if version control can work on this site?).
12345678910111213141516171819202122232425262728293031323334//https://www.prorealcode.com/forum/prorealtime-english-forum/proorder-support/3-day-bull-bear///160417-GH 3DayBullBear UKX 5M (v1.0)DEFPARAM CUMULATEORDERS = FalseThreedaybull = dclose(1)>dopen(2) and dclose(2)>dopen(3)Threedaybear = dclose(1)<dopen(2) and dclose(2)<dopen(3)Currentdaybear = open[0]<((dhigh(1)-dlow(1))/2)Currentdaybull = open[0]>((dhigh(1)-dlow(1))/2)//Go LongIf Threedaybear and Currentdaybull and Close > Average[70](close) ThenBuy 1 contract at dhigh(1)stopEndif//Go ShortIf Threedaybull and Currentdaybear and Close < Average[70](close) ThenSellshort 1 contract at dlow(1)stopEndif//Exit Long (if 'going nowhere')If Close < Average[200](close) and BarIndex - TradeIndex = 210 and Positionperf < 0 ThenSell at MarketEndif//Exit Short(if 'going nowhere')If Close > Average[200](close) and BarIndex - TradeIndex = 210 and Positionperf < 0 ThenExitShort at MarketEndif//Stops and TargetsSet stop ploss 175Set target pprofit 12504/16/2017 at 2:15 PM #32184Good to get away from the screen and ‘have a think’ … above is flawed and that’s why there’s no Short Trades?
With my code
((dhigh(1)-dlow(1))/2)
I wanted mid-price but above will not give mid-price.
I’ll amend later, got to get ready for Easter Family Time!
GraHal
04/17/2017 at 1:05 PM #32297Code Attached: 170417 3DBullBear UKX 5M (v2)
(I’ll have to open Firefox to add code using Insert PRT Code button)
123456789101112131415161718192021222324//https://www.prorealcode.com/topic/3-day-bull-bear///170417-GH 3DBullBear UKX 5M (v2.0)DEFPARAM CUMULATEORDERS = FalseThreedaybull = dclose(1)>dopen(2) and dclose(2)>dopen(3) and dclose(3)>dopen(4)Threedaybear = dclose(1)<dopen(2) and dclose(2)<dopen(3) and dclose(3)<dopen(4)Currentdaybear = dopen(0)<dclose(1)Currentdaybull = dopen(0)>dclose(1)//Go LongIf Threedaybear and Currentdaybull ThenBuy 1 contract at dopen(1)stopEndif//Go ShortIf Threedaybull and Currentdaybear ThenSellshort 1 contract at dopen(1)stopEndif//Stops and TargetsSet stop ploss 100Set target pprofit 12504/17/2017 at 2:07 PM #32309Now how do I get my V2 code at the top of the this Thread as I proposed in my first post?
I’m sure Nicolas is ‘all over this’ with a workable solution so I’ll leave it for now as I know he’s busy and I can’t direct message a Mod.
Maybe another button alongside ‘reply’ … add .itf file to 1st Post … if this could be done and then original posters / Thread Authors can be self-sufficient and add latest version code to their original Post??
GraHal
04/18/2017 at 12:43 PM #32447hey Grahal, you’ll find attached the 200k bars backtest. Not so bad, but surely overfit on last 100k ones I think? Added 1.5 point spread.
Thanks for all suggestions about forums improvements, I heard everything. Sometimes ideas are nice, but involved 1 or 2 days of dev, I think I’ll have to do them on spare time!
04/18/2017 at 10:14 PM #32526I agree Nicolas, ideas are easy … clever is he who makes them happen! 🙂
No dev time for you (you don’t need it!) and no hardship for us … another idea / suggestion below to make latest version code available on the first post of a Thread (voluntary basis).
Thread / Code Authors provide a link in the first post to a folder in their dropbox / google drive / similar where they store latest version code.
Discussions and code can be added as now to the thread at any point, but it would be up to thread originator to add latest version code to his dropbox / google drive.
I can put this on the ‘site suggestions thread’ if you wish, but to round off my ‘crazy ideas above’ 🙂 I added it here to close the loop.
Best Regards
GraHal -
AuthorPosts
Find exclusive trading pro-tools on