MNB 10.4 Streamlined by Snailbeard
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: MNB 10.4 Streamlined by Snailbeard
I'd like to put back in a streamlined version of CSS (H1) because it is an important tool especially on strong retracements:
You do not have the required permissions to view the files attached to this post.
- mjws00
- Trader
- Posts: 609
- Joined: Fri Jan 04, 2013 10:17 pm
- Location: Victoria
Re: MNB 10.4 Streamlined by Snailbeard
I'd love to see H1 CSS in a version that can back test. Very nice work snailbeard.snailbeard wrote:I'd like to put back in a streamlined version of CSS (H1) because it is an important tool especially on strong retracements:
Your code cleanup exercise there was excellent. Very rare to see that thoroughness applied to MQL.
Mike
Reading the dark heart.
- Baluda
- Trader
- Posts: 330
- Joined: Mon Feb 06, 2012 2:00 pm
- Location: An insignificant village in the Netherlands
Re: MNB 10.4 Streamlined by Snailbeard
Beard,snailbeard wrote:I'd like to put back in a streamlined version of CSS (H1) because it is an important tool especially on strong retracements:
What do you mean by 'streamlined'? Can I do anything (on LibCSS)?
Paul
Check the MQL4 Market for my best EA's and Indicators.
- Baluda
- Trader
- Posts: 330
- Joined: Mon Feb 06, 2012 2:00 pm
- Location: An insignificant village in the Netherlands
Re: MNB 10.4 Streamlined by Snailbeard
At least it is consistent...
Paul
You do not have the required permissions to view the files attached to this post.
Check the MQL4 Market for my best EA's and Indicators.
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: MNB 10.4 Streamlined by Snailbeard
Actually, I just mean that I would save the calculated values in a multi-dimensional array, some EAs are recalculating everything on every tick, which slows down testing, but not necessarily a problem when running live.Baluda wrote:Beard,snailbeard wrote:I'd like to put back in a streamlined version of CSS (H1) because it is an important tool especially on strong retracements:
What do you mean by 'streamlined'? Can I do anything (on LibCSS)?
Paul
Something I would like to add to my calculations when checking CSS is the recent past:
Save x bars of CSS difference for each pair
Save x-1 bars: Measure the change
Save x-2 bars: Measure the rate of change
A steady change towards cross over can be a leading indicator,
and a steady change which crosses over and continues confirms the change.
An increasing rate of change can be a build up to a bigger move.
I also might store the bar-distance since RSI was high/low:
If RSI2 was recently at the bottom/top and (CSS-ROC > threshold) then it could be strong confirmation of a reversal.
Many thanks for all the hard work that you have put into these indicators they are really useful!
Brian
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: MNB 10.4 Streamlined by Snailbeard
I have not had chance to put in CSS as yet because I was completing some other code changes. I have lost the ability to set run time parameters since I included some files to do with LibOrderReliable. However, I have changed the approach to back testing so that the EA now checks the number of Bars for the symbol and timeframe so that it skips days when there is not enough historical data to calculate the long moving averages. We no longer have to hard code the date limits in the start() function.
The preliminary results for GBPUSD on GP are very promising although the EA is now adding extra trades which could be a bug and improvements could be due to curve fitting. Therefore, more testing on demo accounts and BT on more currencies for longer history is required. In addition, this test was run on H1 open bar only, so the accuracy is questionable. The H1 limitation affects exit and stop management not order creation so if anything I would expect worse results, on the hand an absence of price spikes through pending orders could be reducing losers.
The preliminary results for GBPUSD on GP are very promising although the EA is now adding extra trades which could be a bug and improvements could be due to curve fitting. Therefore, more testing on demo accounts and BT on more currencies for longer history is required. In addition, this test was run on H1 open bar only, so the accuracy is questionable. The H1 limitation affects exit and stop management not order creation so if anything I would expect worse results, on the hand an absence of price spikes through pending orders could be reducing losers.
You do not have the required permissions to view the files attached to this post.
-
nonlinear
- Trader
- Posts: 293
- Joined: Fri Jun 01, 2012 2:56 pm
- Location: Washington DC
Re: MNB 10.4 Streamlined by Snailbeard
Hi Brian, I am running version 2 and have not had any errors yet. Looks good so far.
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: MNB 10.4 Streamlined by Snailbeard
Glad that you are getting on well with this version.nonlinear wrote:Hi Brian, I am running version 2 and have not had any errors yet. Looks good so far.
I had a busy week last week and created an alternative version of Baluda's Currency Slope Strength in which the indicator parts are separate from the functional code. The functions can be included into both indicators and EAs. In addition, I have reworked the code so that calculations are performed only once per H1 bar or once per H4 bar and a short history of previous calculations are stored in arrays for further analysis. This required quite a bit of house keeping utility code - the kind of stuff you get for free in C#, Java, C++ etc... groan.
This would have been fully finished by now if it wasn't for the idiosynchrosies of Empty4, but my version of the indicator suddenly stopped working yesterday, after several hours of detective work not finding any real cause I then tried the same code in another copy of Empty4 only to find that it did not produce the bizare results.
Needless to say both versions of Empty4 are now again consistent.
- snailbeard
- Trader
- Posts: 615
- Joined: Mon Dec 24, 2012 10:54 am
- Location: Just above water somewhere between Oxford & Cambridge
Re: MNB 10.4 Streamlined by Snailbeard
To bailout or not to bailout that is the question here...
It has taken a lot of coding and debugging to add a few stripy lines to Baluda's CSS indicator, however, we can now visually backtest the idea of bailing out of a trade when CSS reverses beyond a certain threshold.
It should be possible to use this code with minor changes directly in an EA, this was the intended aim, the indicator version is just so I could visually see if the code does what it is supposed to.
In the attached screenshot we can see that sometimes bailing out can turn a profitable trade into a loser. So the question is whether-or-not there would be an overall benefit to using this method, and to answer that we need to look at a statistically signifcant number trades which meet the bail-out conditions then see if profits improve or losses increase.
We might also want to qualify the use of the bail-out option: perhaps the bail out should only be applied if the H4 MA 240 indicates a stronger trend.
Or in a stronger trend are there better ways to exit than using a CSS bail-out threshold?
Has anyone already done this analysis or should we plug the code into an EA and collect same data?
For those interested in analysis by back testing I am hoping that the new code will run fast in CrappyTester.
In the first snapshot I have labelled potential trades, exits and TP.
The second snapshot is a during a consitent trend where the reversals never reach the H4 MA240. This is when stop losses at the H4 MA240 rarely get hit and Nanningbob advises us that we can ride these reversals if our accounts can manage the drawdown. Those working with smaller lot sizes can simply add to their positions when the trend resumes.
It has taken a lot of coding and debugging to add a few stripy lines to Baluda's CSS indicator, however, we can now visually backtest the idea of bailing out of a trade when CSS reverses beyond a certain threshold.
It should be possible to use this code with minor changes directly in an EA, this was the intended aim, the indicator version is just so I could visually see if the code does what it is supposed to.
In the attached screenshot we can see that sometimes bailing out can turn a profitable trade into a loser. So the question is whether-or-not there would be an overall benefit to using this method, and to answer that we need to look at a statistically signifcant number trades which meet the bail-out conditions then see if profits improve or losses increase.
We might also want to qualify the use of the bail-out option: perhaps the bail out should only be applied if the H4 MA 240 indicates a stronger trend.
Or in a stronger trend are there better ways to exit than using a CSS bail-out threshold?
Has anyone already done this analysis or should we plug the code into an EA and collect same data?
For those interested in analysis by back testing I am hoping that the new code will run fast in CrappyTester.
In the first snapshot I have labelled potential trades, exits and TP.
The second snapshot is a during a consitent trend where the reversals never reach the H4 MA240. This is when stop losses at the H4 MA240 rarely get hit and Nanningbob advises us that we can ride these reversals if our accounts can manage the drawdown. Those working with smaller lot sizes can simply add to their positions when the trend resumes.
You do not have the required permissions to view the files attached to this post.
- mjws00
- Trader
- Posts: 609
- Joined: Fri Jan 04, 2013 10:17 pm
- Location: Victoria
Re: MNB 10.4 Streamlined by Snailbeard
I've been meaning to do this analysis as well. Haven't had time yet. I figured I'd have to dump or capture data somewhere to get css to play nicely in a back test. I have done lots of visual back testing, with the CSS bailouts and entries. Frankly I don't think the bailouts are any better than a psar, or shifted MA. But would love to see hard data. I think a lot of the added value is visual. Are we converging, diverging, parrallel, flat, etc.
I'd love to see some proper stats. Not to mention, is there a huge difference using a closed bar vs. the live bar? It doesn't seem to whipsaw much, but the price is paid for in lag. 15M and 30M are actually quite nice as well. Still very few false signals, and much more responsive for entries.
Nice work snailbeard. I'd love to be playing and coding with this more.
Mike
I'd love to see some proper stats. Not to mention, is there a huge difference using a closed bar vs. the live bar? It doesn't seem to whipsaw much, but the price is paid for in lag. 15M and 30M are actually quite nice as well. Still very few false signals, and much more responsive for entries.
Nice work snailbeard. I'd love to be playing and coding with this more.
Mike
Reading the dark heart.