Strategy TrendImpulse v1
Forums › ProRealTime English forum › ProOrder support › Strategy TrendImpulse v1
- This topic has 74 replies, 6 voices, and was last updated 1 year ago by thomas2004ch.
-
-
05/26/2020 at 2:23 PM #133330
Its logic seem to favor trena=-1 (since it’s only 1 if trend = 1 and line1>=line2). How does this make sense?
I will be honest. Actually I didn’t pay much attention, it was obtained from https://www.prorealcode.com/prorealtime-indicators/perfect-trend-line/ and I adjust it for strategy. I just verify if the entry is correct referring to the indicator.
Also, I’m confused by the numbers switching from 1 for bullish to -1 for bullish to 2 for bearish, etc. It would make more sense to just use 1 for bullish and -1 for bearish imho.
Yes, I think it will work too. Specifying 1 and 2 just my preference, as sometimes I might initialize a variable as -1 to indicate invalid state (e.g. if it is not obvious either state), though not applying to this scenario. Alternatively can be using 2 flags (1 for bull, 1 for bear), but usually I don’t do so, except for readability.
05/27/2020 at 9:43 AM #133404@yahootew3000 I checked the original indicator, it works with a “SlowLength” and a “FastLength”. As long as the “SlowLength” is larger (and thus slower), it shouldn’t be a problem. In your WalkForward, there is no check on this. The outcome could be that the SlowLength is smaller (and thus faster). Especially during times when the market falls, since it favours short trades.
You could solve this problem by limiting the range of SlowLength and FastLength, so they don’t overlap. Or by defining SlowLength as “FastLength+Distance”.
1 user thanked author for this post.
05/28/2020 at 10:55 AM #133590Hi All,
I’m also struggling with an issue regarding an indicatorand I do believe its the same rewference that @wil stated. Here I have attached it in the image but as i’m not a coder i’d appreciate it if someone could upload the code change that needs to happen to resolve this issue for me.
Best wishes,
Plaedies
05/28/2020 at 2:40 PM #133621someone could upload the code change that needs to happen to resolve this issue for me
Try replace this part,
12345bollMA = average[length, 1](close)//50,1STDDEV = STD[length]bollUP = bollMA + 2 * STDDEVbollDOWN = bollMA - 2 * STDDEVbollPercent = 100 * (close - bollDOWN) / (bollUP - bollDOWN)With this,
12345678910bollMA = average[length, 1](close)//50,1STDDEV = STD[length]bollUP = bollMA + 2 * STDDEVbollDOWN = bollMA - 2 * STDDEVIF bollUP = bollDOWN THENbollPercent = 50ELSEbollPercent = 100 * (close - bollDOWN) / (bollUP - bollDOWN)ENDIF06/08/2020 at 4:10 PM #135207So if I wanted to run this strategy from the UK, do I
a) Just change the UTC+8 to UTC+1?
b) Change the PC system time to Singapore (for example)?
c) Change the platform time to UTC+8?
d) Change all the times in the code to x-7 hours?
e) a selection of the above
I’m a bit baffled really I’m afraid.
If I run it with all my UK default settings and with the code unadjusted, the results looks OK anyway…
Many Thanks.
06/24/2020 at 6:10 PM #137046Please @Nicolas, the code below is part of the Indicator you posted on the link … can you confirm that trena (used 5 times) is not a typo that should read trend??
https://www.prorealcode.com/prorealtime-indicators/perfect-trend-line/
Many Thanks
1234567891011121314if (Close[0]<line1[0] and Close[0]<line2[0]) thentrend = 1endifif (Close[0]>line1[0] and Close[0]>line2[0]) thentrend = -1endifif (line1[0]>line2[0] or trend[0] = 1) thentrena = 1endifif (line1[0]<line2[0] or trend[0] = -1) thentrena = -1endifif trena<>trena[1] thenif trena=1 then06/24/2020 at 6:54 PM #137049So if I wanted to run this strategy from the UK, do I
I reckon you need times as below …
Out of interest … I deleted time and month constraints … and out 348 trades over 100,000 bars 1 min TF, it made a difference of – £22 on £1599
123456789mar = month = 3 // MONTH STARTnov = month = 11 // MONTH ENDIF (month > 3 AND month < 11) OR (mar AND day>14) OR (mar AND day-dayofweek>7) OR (nov AND day<=dayofweek AND day<7) THENUSDLS=010000ELSEUSDLS=0ENDIFtimeok = NOT(time >221500- USDLS AND time <223000 - USDLS) AND NOT(time >110000 - USDLS AND time <120000 - USDLS)06/25/2020 at 7:00 AM #13707608/08/2020 at 9:12 PM #14117208/26/2020 at 6:14 PM #142638someone could upload the code change that needs to happen to resolve this issue for me
Try replace this part,
12345bollMA = average[length, 1](close)//50,1STDDEV = STD[length]bollUP = bollMA + 2 * STDDEVbollDOWN = bollMA – 2 * STDDEVbollPercent = 100 * (close – bollDOWN) / (bollUP – bollDOWN)With this,
12345678910bollMA = average[length, 1](close)//50,1STDDEV = STD[length]bollUP = bollMA + 2 * STDDEVbollDOWN = bollMA – 2 * STDDEVIF bollUP = bollDOWN THENbollPercent = 50ELSEbollPercent = 100 * (close – bollDOWN) / (bollUP – bollDOWN)ENDIFthe problem still run with your new code, have you some suggestion?
08/27/2020 at 5:26 AM #142666@bidolia, likely you are using v2a that has the “machine learning”. This part is quite common to have division zero problem, I have removed it from all my strategies as I also find it hard to have consistency and hard to control efficiency (maybe I didn’t use it right). Since there is interest on this strategy, I have been working on another version removing the machine learning code.
1 user thanked author for this post.
10/27/2020 at 2:04 PM #14865510/28/2020 at 2:30 AM #14873905/15/2021 at 10:41 AM #169732Many thanks, I have been playing with and testing this on a demo account. It works well.
My question is:
When it opens a trade, It sets the Open, then 300 pts away, a stop. But no target price?
Does the code allow for movement then to implement a target, moving the stop closer as the price rises stop, or am I missing something?I am just trading Long, and have observed it make some significant gains, but then give it back as there is no target price or movement of the stop?
Thanks in advance.12/26/2022 at 2:30 PM #206330Hi,
Is this strategy suitable for daily SPY?
Regards
-
AuthorPosts
Find exclusive trading pro-tools on