ProRealCode - Trading & Coding with ProRealTime™
//StartingValue3 = 25 //28 //24 //200 -- Bandedge 25
//etc
//etc
//MinValue3 = increment3 //Minimum allowed value
When I use the term HAlgo3 I am referring to the No 3 / 3rd Heuristics Algo within your ML3 System.
What is your concern with cross referencing?HAlgo3 cannot use any commands from HAlgo2 and HAlgo2 cannot use any commands from HAlgo1 … else the ML would all get screwed up. Reading later on your last 2 posts … you knew above, but are you certain it is not happening?? PS What is this ‘coffee’ you keep referring to??
HAlgo3 cannot use any commands from HAlgo2 and HAlgo2 cannot use any commands from HAlgo1 … else the ML would all get screwed up. Reading later on your last 2 posts … you knew above, but are you certain it is not happening??It’s very hard to know… but I expect Juanj is correct in that it’ll make it difficult for the system to know what is increasing its profit expectancy. But I just had to see what would happen and experiment with it…. Below is the evolution with coffee, (I thought I’d test ML on something I never trade, have no bias towards or feeling about its volatility that would influence me in my settings prefernce). The base, non ML system is using long entry at -0.8 crossover / short at 0.8 cross under with a 100 bandedge, (setting that have worked well on other instruments). Pls see image and results. The next one up, ML 2 doesn’t use heuristic cycle limit, just algo 1 and 2 for the entry exits with a fixed bandedge of 100. System ML3 Old is my non heuristic cycle limit “see what would happen” 3 algos all added together. System ML3 New is with the heuristic cycle limit for algos 1 and 2. Algo 3 is still not being monitored by the heuristic cycle limit although the algo 3 is altering its bandedge judging by Graph ValueZ. Is that 3 x heuristic cycle limit initiation and the rest of the heuristic cycle limit code I posted above correct, I ask because when I try to use an “If HeuristicsAlgo3 = 1 Then” command at the beginning of Algo 3 (at the bottom of the code, that controls the oscillator bandedge), it doesn’t take any trades at all. Can anyone clear up the issue of the incorrect syntax (despite no PRT warning) because there is a float of code from the right margin (see previous post)? I suspect once that’s cleared up it’ll run fine. It would be good to get this triple ML system working using and amending the code I posted above! When that is done @bertrandpinoy I can itf the code. If you want to play around with the code above (ML3 New) here it is plus the Ehler’s Universal Oscillator indicator: Edit: I don’t see the itf’s despite attaching them to this post?
System ML3 New is with the heuristic cycle limit for algos 1 and 2.Do you know if the heuristic cycle limit is working for HAlgo 1 and HAlgo 2? We could do with a counter in the code so we for definite?
I can only judge it from the graphs and I’d say yes and no. Pls see Graph X and Y image. It looks like the oscillator entry/exit is not working most of the time with cycle limit (whereas when not using cycle limit these thresholds do vary all the time throughout the backtest date range). The bandedge is of course working but that wasn’t being governed by the cycle limit… It seems to me that I have had more problems getting systems to work with the cycle limit code, for example I’m looking at the Pivot system I posted a few days ago and that works if the cycle limit is rem’d out/blocked.
Maybe the counter code would be a good idea? I think the results are better without cycle limit, so far, what do you find when you test with and without the cycle limit? I preferred this code when it was sans cycle limit, far less troubleshooting, ha ha. I know, I know … avec cycle limit should be far superior. Also realised why my system keeps hanging: (2nd image), oops… 😃
We could do with a counter in the code so we for definite?Can you do that? It may help explain why the X and Y thresholds for the Oscillator being identical for most of the backtest but then slightly varying a little later on – as per screenshot above.
how does the system know where the improvements are coming from?As you know … it does not need to know for it to work as each HAlgo acts independent of each other, but 2 changes simultaneosuly may not be in the most beneficial direction for both (at same time)? I guess if HAlgo1 optimised an entry variable and HAlgo2 optimised an exit variable then HAlgo1 would not muddy the waters for HAlgo2?
pretty amazing performanceSo do you have that System on Forward Test now then?
I guess if HAlgo1 optimised an entry variable and HAlgo2 optimised an exit variable then HAlgo1 would not muddy the waters for HAlgo2?But Algo2 can only be measured in the context of what Algo1 is doing? All systems are interdependent with their entries and exits, no? The systems only concern is to see if the last 3 days (reps) performance was better than the last stored performance (B), it doesn’t care where the performance comes from. If -0.6 entry and + 0.9 exit produce the most profit it will set out to beat that in the next 3 Reps.
So do you have that System on Forward Test now then?Not live demo, no. I had this bizarre time consuming issue where the cycle limit system with 3 algos turned out to be identical to another slightly differently named system and yet the profits were £67k versus £31k! Put the code from the £67k into the £31k template and it made £67k, yet the code is identical, went through it line by line, side to side three times! Still have no idea, guess I’m keeping the £67k system… I’m still looking at theses Univ Osc systems, figuring out what’s best in terms of using the cycle limit, whether 2 algos is better than 3. It’s tricky stuff, you think it’s complete then you realise it’s not optimal because you realise the “ElsIf HeuristicsAlgo2 = 1 Then” command have been rem’d out because you’d omitted it in earlier testing, seeing how the two or three Algos performed without cycle limit…. As per the code in this post: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/8/#post-126009 Lot to take it and test! And I feel this is only the start, imagine cycle limit and 4 or 5 algos because now you’re self optimising trade size and maybe a trailing stop as well as entry / exit thresholds and bandedge… Without cycle limit it’ll not be using the ML code to it’s full potential.
went through it line by line, side to side three times!You should use this free website … a few seconds to copy and paste 2 versions of code, click ‘Find Difference’ and hey presto all the differences highlighted! No need to register, but if you do then you can even save the compared codes for later as equired. https://www.diffchecker.com/diff
Hi @Nicolas, is it possible to take a look at this heuristic cycle limit initialisation code below? I’m using it at the very beginning of a system but it doesn’t take any trades. The code below adds an extra HeuristicsAlgo “#3” to the code of a system that does work found here: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/3/#post-121130
That page 3 system Juanj posted (#121130) only uses two algos: HeuristicsAlgo1 and HeuristicsAlgo2. I am attempting to get the machine learning/self optimising system to work with 3 algos using Ehler’s Universal Oscillator: ValueX for the entry threshold, ValueY for exit threshold, and ValueZ for the bandedge setting. When I’ve made systems using this machine learning code but without the heuristic cycle limit code, the results are very encouraging: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/8/#post-126009 Thanks for any input, Cheers Bard.once HeuristicsCycle = 0
once HeuristicsAlgo1 = 1
once HeuristicsAlgo2 = 0
once HeuristicsAlgo3 = 0
If HeuristicsCycle >= HeuristicsCycleLimit Then
If HeuristicsAlgo1 = 1 Then
HeuristicsAlgo2 = 1
HeuristicsAlgo1 = 0
HeuristicsAlgo3 = 1
ElsIf HeuristicsAlgo2 = 1 Then
HeuristicsAlgo1 = 1
HeuristicsAlgo2 = 0
HeuristicsAlgo3 = 1
ElsIf HeuristicsAlgo3 = 1 Then
HeuristicsAlgo1 = 1
HeuristicsAlgo2 = 1
HeuristicsAlgo3 = 0
EndIf
HeuristicsCycle = 0
EndIf
If HeuristicsAlgo1 = 1 Then etc
// Heuristics Algorithm 2 Start
If onmarket[1] = 1 and onmarket = 0 Then
optimise2 = optimise2 + 1
Endif
"|"<------ this cursor didn't seem be fully returned
StartingValue2 = -1
ResetPeriod2 = 6 //Specify no of months after which to reset optimisation
Increment2 = 0.1
When I’ve made systems using this machine learning code but without the heuristic cycle limit code, the results are very encouraging: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/8/#post-126009The link above is a link to use of the Heuristic Cycle Limit … is this what you meant to libk to?
If HeuristicsAlgo1 = 1 Then HeuristicsAlgo2 = 1 HeuristicsAlgo1 = 0 HeuristicsAlgo3 = 1Doesn’t above mean that HeuristicsAlgo2 and HeuristicsAlgo3 would work together at the same time?? Your code below looks to me as though it should work for 3 HAlgos?? https://www.prorealcode.com/topic/machine-learning-in-proorder/page/8/#post-126009
Machine Learning in ProOrder ProRealTime
This topic contains 454 replies,
has 32 voices, and was last updated by Khaled
4 years, 7 months ago.
| Forum: | ProOrder: Automated Strategies & Backtesting |
| Language: | English |
| Started: | 08/06/2017 |
| Status: | Active |
| Attachments: | 207 files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.