I attach a picture of the same LinReg indicator except this one is invisible and has two periods, 1 at 32 and 1 at 21, i.e. LT is about 1.5* the ST. When they both line up, the trend color is back coloured (gold or blue in my case for up or down respectively); when they are out of synch the back color is green. It's simple and quite effective.
This two-period mutual confirmation approach could easily be included in the strategy but again, the idea here is really not about finding a great entry system, rather setting up a good testing template.
Well, I suspect nobody is interested in this now because the coding issues became overly complicated.
That said, I did sort of finish the original indicator now even though I have been stumped by transferring it to a strategy.
So the stops and profit targets can be plotted based on the trend conditions which of course can be changed into whichever others one might prefer.
There are two choices for stop and target placement, with the PT amounts being controlled by the same Ratio multiplier input. One method uses the Donchians to establish trailing stops, the other is based on ATR(period).
I have also added in a trend filter which is a longer term line (backcolor option). This method is quite similar to the Viper system that I gather created a bit of stir on this and other forums a while back. I liked it when I first saw it mainly because the charts seemed so free of clutter. (I have not tested it in a strategy but suspect it will do well most of the time but then every so often get hit with 7-10 losers in a row since it is a trend-following approach with entries seemingly based on breakouts of the Donchian 5-bar channels.)
In any case, the indicator as coded provides a template for anyone who wishes to visually test different types of entries.
I have also made a pattern-based indicator doing essentially the same thing, the stops based on the entry bar range and the PT's based on a Ratio multiplier of that same range.
The two patterns included are simple: inside bars (which have less risk usually since they are nearly always relatively narrow) and a 'momentum' bar which is when the close is within 1 tick of the high or low & in direction of ST trend as defined by the infamous LinReg. Of course you can use any other trend condition you like. This one also includes a simpler bar-based trend condition which is just two closes in the same direction. I put in the trend condition to reduce the plots by having the code pick a direction, otherwise would have to plot both directions at the same time which is far too complicated.
I am not including these in the download share section yet in case there is any feedback in terms of using these for risk-reward analysis.
I tried outputting statistics in the bar pattern version but kept crashing Ninja with memory overload, so clearly I was doing something wrong. The idea was to have a text message in lower left tracking percentage of winning signals to total signals which would make it much more helpful as an indicator used to quickly scan various pattern ideas. The text/tracking section has been commented out so no worries in terms of downloading this to check it out.
1. LRltstoppt1 shows the indicator most mentioned in this thread. (The magenta hash plots are of the barpattern indicator which I forgot to remove from the chart.) The stops are trailing Donchian Square Plots or ATR stop plots - color-coded for trend - and the PT's are green Hash plots. ( This chart uses the ATR option.) If the first tgt is hit or one is stopped out but the trend resumes with a close in the trend direction, a second green PT is plotted based on the new stop and PT which makes it visually easy to see if an initial signal and risk-reward ratio worked and/or yielded extra profits (for multiples or to increase the Ratio to set the PTs).
After posting this I added in a VWAP-based condition to plot triggers only when OB/OS basis the VWAP std deviation Zone 1's.
2. GCVolBarPatt-BetterVol2 shows the BarPattern indicator which is basically the same as the first one with different entries. There is a wrinkle: I have a set of options when using Roonius PF charts (Type = 5).
3. In terms of the second picture and BetterVolume2b:after getting some templates from the HG thread and liking the black backgrounds and larger texts, and also after reading the first two pages of Eric J's indicator-free emini journal (which does seem to have some indicators after all but is one of the best threads I have ever read anywhere in terms of clarity and sharing lessons and method), I liked the look of his Volume Charts which I have avoided only because the Better Volume Indicator doesn't work so well on a Volume Chart and it is one I like to have. So today I altered the BV to plot the OBV when a Volume Chart is loaded and added in a couple of extras like divergence plotted below the bars and an average above that changes color with the OBV trend. Once I am sure it is working right with live action I'll put that in the sharing section.
Note: I went back to that thread today after coding all this and was amused to see that he had added in VWAP bands just as I had done after reading his thread and trying to pick just one indicator to throw up along with the bars. Hopefully this is a case of 'great minds thinking alike'!
4. The RPM indicator (in the shared section) now has different colored plots (not in shared section yet) for when there is acceleration of ticks-per-second with up or down close. Helpful with non-time-based charts, but also time-based ones too because an alert can be made to sound when things speed up which is handy if one is away from the computer.
5. For anyone inspired/curious, I attach also the BetterVolume2b indicator which plots differently when using Volume Charts. I also have a RangeBar version but it's not very good. I wish someone competent could include bid-offer or uptick/downtick info to make the up-down bars better in the Better Volume. When I was on Tradestation I changed Barry's code to include this capability and he liked it and then included it. It works. I think this can be done now with some of Gom Delta cumulative indicators, but that is beyond my coding capability to include and in any case I suspect with NT7 this will all be much easier so Ninja users will be able to have a better Better Volume indicator in line with the TS version.
Note: 822pm EST added final version of BarPatterns1.zip including VWAP trend conditions for both pattern and LinReg based trend conditions.
Suggestion: SwingType = 4 (LR line with VWAP condition) with Type4 (Tgt plots), Ratio 1.5 or more looks promising in terms of raising percentage of times tgts are made with >1 risk-reward ratio. Filters out many triggers with VWAP-based OS/OB condition. More importantly, the indicator quickly reveals how such changes effect probabilities, nr. of trades triggered etc. so is already helpful that way.
Last edited by cclsys; November 8th, 2009 at 08:59 PM.
Reason: clarification; inclusion of BetterVolume2b
The following 3 users say Thank You to cclsys for this post:
So his approach is to go for high probability small winners, move stop to BE quickly, then every once in a while catch a runner for much more.
Wish I could program something like that in Ninja. Will scour their forum for a strategy template that has multiples (stops and profit targets) to use as a template. Previously could never find one but suspect one is there somewhere.
Generally it would be helpful for many of us in Ninja to have such a template. The entry and exit conditions are not so important, rather having a template upon which different ideas can be tested.
Parameters I would like to have would be:
Start and End times (perhaps 2-3 per day to test for times)
Max DD per day, Daily Profit Target after which stop trading
Ability to double up and/or expand PT's during DDs
Multiple entries and exits, or at least scale-out exits with multiple conditions.
Different exit options.
Risk-reward ratio used to determine PT's and/or entries on pullbacks to get price within acceptable R-R parameters.
If anyone has such a basic template - or close - would much appreciate it being posted for download (can x out the entry conditions if they are highly prized and just put in if (entrycondition)...
well - its not that your stuff is not interessting, but for me its really to big to get into it in some minutes.
i think you are right that your coding-stuff is really complex - too complex to do it beside without taking half a day off to get though.
the first thing i thought was : i would make this in 2 or 3 seperat indicators - but i am not big in coding
so be shure that you postings+ideas are welcome + and really interessting + give time a chance that some guys (incl me!) find the way into it !
Last edited by max-td; November 9th, 2009 at 04:32 AM.
The following user says Thank You to max-td for this post:
More than half a day. I've been doing this for a few days now, just pulled an all-nighter. I want to get this sort of research work out of the way ASAP (at least this phase of it) and then just work on trading and price action without coding for a few weeks. Find it hard to do both.
I like PF charts and hope NT7's are better than Roonius' current ones, although they are fine.
Using this simple Bar Pattern Indicator with ratio set to 1.5 and trigger using the LinReg trend filter + inside or momentum closes bars, I just noticed that this chart I had up all day in the background from this morning has several winners in a row.
I think that the VWAP condition, although it limits many entries, is something to keep in mind in the background, because it also raises possibilities of snap-backs to the mean.
One thing the PF charts do that many people are not aware of is that because the trend moves often take place in only a few bars - the fast big ones that is, the mean price doesn't trend so quickly.
But since I am using the VWAP, this supposedly makes no difference (which is why I chose it). On the PF charts you often see steep oscillations away from the VWAP and then prices returning to it. The PF charts condense time even more than Range or other configurations. They are not ideal for scalping in the normal way, but it seems that for certain types of 'rubber band' trades whose zones get set up only 2-3 times a day, they are worth taking a look at.
That said, the Risk-Reward indicator is helpful at immediately identifying levels that seem to work.
Actually, this chart (gold) is a little freaky. There is a big up (yellow) bar at 913 with a target WAY above the mkt, so reasonably one would not take such a trade if the stop were below the low as this indicator assumes. But waddya know: tonight it was hit in the early going (the Asians are active in Gold whilst we sleep) to the tick.
Another big down bar at 9.49 hit almost to the tick at 10.49.
Then first bar of night session last night around 6 pm with target way above, hit to the tick around 1.47.
I don't think any of these are tradable for me personally right now since I am working a small training account, but it is interesting that just insisting on a decent risk-reward ratio reveals certain possibilities that otherwise I just wouldn't see, being more concerned with timing the entries and exits based on market action alone.
This exercise thus far has been very helpful for me - even if it is a little difficult to follow for anyone else.
So thanks! And thanks to BM for the forum.
PS. The reason for this chart in the first place is that it is one of my attempts to get something with basically only 1-2 indicators tops.
Volume charts with this configuration are also good, with many more opportunities, but also more false starts, but still the VWAPs alone are pretty much all I need I think, although having donated a little money and spent some time looking at the 'elite' indies, I am tempted to have one oscillator up there, and that d9particle (what a great name) looks pretty good, especially its extreme readings.
I also think Cory's VolumeStop indicator is excellent and I am leaning now towards overlaying the BetterVolume2 with Volume stopIV on the same lower panel, with the Vstop SR lines on the top panel and possibly also the d9 oscillator on a lower panel with the d9 SR dots also on the chart and, with the VWAP lines, letting that be it. Possibly a 30 bar KAMA MA which is also excellent, but then it is getting busy again, esp. with Cory's triangles and diamonds and all the rest.
Thus far my favorite super simple chart is the VWAPs with Volume (and RPM speed indicator which is just a simple functional thing rather than being anything to do with signals.)
Actually, you can go smaller then 1 on the slope - I assume that is your 'tweak'? I use .005 to .007 for currencies.
Usually I use 7 for Tick Charts and 10 for Range Bar charts because the tick charts have many more narrow bars that the Range Bars filter out by definition.
With the currencies, you have to divide it by 10 for the extra decimal pt. No need to rewrite the code, just change the 'Slope Factor' input in the menu panel from default 10 to 1 or .07. It's a double in the code, not an input, so decimals are no problem.
Sorry I didn't mention that, but I don't personally monitor those and forgot to say anything.
There are two main 'systems':
One uses the Donchian (x) - usually 2-3 for me for this sort of testing.
And also there is the ATR option instead of the Donchian.
I added in something called 'ltstoption) which means that both trends (lt and st) have to be aligned for an entry trigger. If false, then just the st line trend is used.
There is not much difference between ATR and Donchian because I forgot to put in the ATR multiple in the coding. It's there, but I forgot about it. I'll add it in tonight and post the revision. The idea is to be able to test the ATR by multiplying it to expand and contract how tightly it configures the stops and PT's.
Ultimately, it doesn't make much difference. The Donchians stay with the range of the bars as they are, so they too adapt to volatility without any fuss. Frankly, I think it's fine just to test with the Donchians, the big thing being whether it is 2bar Donchian or 10 bar. Then the main point of this is to play with the Ratio to see how well expanding it works in terms of targets being hit or positions that could have been profitable not reaching tgt and getting stopped out. There is no Breakeven with this indicator though probably there could and should be since that makes a big difference. But it's mainly just to quickly throw up the targets based on the ratio to give a fast idea of what sort of targets are reasonable.
I wish I could print out statistics on the screen but that is beyond my Ninja language skills at this point, although maybe I'll take another crack at it over the weekend.
Ideally also they could be printed to a file so that one can quickly throw up a spreadsheet, make a template, and get stats.
That is why I would prefer to put this into a strategy: not to trade, but to get fast stats.
Also, the trans is not helpful anymore since I added in the two-trend backcolor capability to the main version (...Ratio1). So the line plotted is the lead (st) line, the longer term is not plotted, but when both line up the backcolor changes accordingly.
I suppose I could make the colors line up on the st line but just didn't think about it. Doesn't really matter.
And the other one you have up there ...GaussST2.. is earlier version that became the ...Ratio. So the Ratio does it all alone now.
The following user says Thank You to cclsys for this post:
Picture of 6B with Slope at .01. The idea is for the green periods to not last too, too long, although here they could be let a little longer, so .007 - .01 is probably around right for the currencies with a Range Bar and .005 to .007 for tick and minute charts. This is not something to be played around with to look for the best fit, just that tick and range charts are different, that's all. Plus the complication dealing with currencies.
OK, here is the changed code. I had the ATRmulti in there already but it wasn't showing up in the menu panel so I didn't use it - forgot that I had it in the code. Now it shows up in the menu panel it's in the code again so you can expand-contract the initial stop based on the ATR multi (in ATR mode), and then expand the PT from that stop amount using the 'Ratio' input.
Hope that's clear:
The Donchian method just takes the Donchian level at the trigger bar as the stop value, then Ratio multiplies that stop to set the targets.
The ATR option sets the stop as a multiple of the ATR using the ATRmulti input, then again Ratio is used to multiply that initial stop to set the targets.
I will add in a final option: entry being 1 tick above/below the trigger bar. Once that is in, I'll upload it and probably that will be it with this analysis-assisting indicator.