NexusFi: Find Your Edge


Home Menu

 





Working on profit-loss ratio


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cclsys with 25 posts (16 thanks)
    2. looks_two Jugador with 7 posts (1 thanks)
    3. looks_3 max-td with 3 posts (1 thanks)
    4. looks_4 sam028 with 2 posts (0 thanks)
    1. trending_up 15,047 views
    2. thumb_up 18 thanks given
    3. group 5 followers
    1. forum 39 posts
    2. attach_file 28 attachments




 
Search this Thread

Working on profit-loss ratio

  #21 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

Attached Thumbnails
Click image for larger version

Name:	LRbackcolor.png
Views:	320
Size:	45.2 KB
ID:	4085  
Attached Files
Elite Membership required to download: LRLTtrans.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #22 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

Attachment Notes:

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.

Attached Thumbnails
Click image for larger version

Name:	BigMike LRltstpt1.png
Views:	345
Size:	57.0 KB
ID:	4235   Click image for larger version

Name:	BigMikeGCVolBarPatt-BetterVol2.png
Views:	313
Size:	59.6 KB
ID:	4236  
Attached Files
Elite Membership required to download: LRstopsPTratio1.zip
Elite Membership required to download: BetterVolume2b.zip
Elite Membership required to download: BarPatterns1.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #23 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


I checked out a new Ninja Trader Partner tonight and on one page pasted the following description of his method:

ACE stands for Anticipate, Confirm, and Execute

Basically I scalp points of the markets and here is how it’s done:


  1. I look for possible points of entry as anticipated
  2. I wait for the market to reach these points
  3. Once there, I then confirm with my technical system and get ready for a trade
  4. My final confirmation comes from my pressure system which shows me clearly who is buying or selling and who is creating more pressure
  5. When the pressure agrees with my technical levels of entry then I execute
  6. Using this method, I take 2 to 6 trades a day.



I have a 3 contract method which is about 85% winner as you will see in the recording below.


  • Stop loss is 6 to 8 points
  • First target is 2 to 3 points
  • Second target is 4 to 6 pints
  • Last target is 15 to 20



85% of the times my first target is hit with a profit and my stop moves automatically to point of entry as a way of protecting my capital.

ACE Strategy

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.

Makes sense.

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)...

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #24 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927

hi cclsys,
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 !

max-td
Reply With Quote
Thanked by:
  #25 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

Thanks Max.

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.)

Anyway.

Attached Thumbnails
Click image for larger version

Name:	BMPFminimal.png
Views:	273
Size:	87.4 KB
ID:	4247  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #26 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927

here a tweaked version of the indicator : LRStopPTRatio1
- now working on 6 B+C+E

with special thanks to wh

also tweaked LRLineLTtrans to work in the 6`s
+ LRGaussST2

max-td
Attached Files
Elite Membership required to download: LRStopPTRatio1_mx.cs
Elite Membership required to download: LRLineLTtrans_mx.cs
Elite Membership required to download: LRGaussST2_mx.cs
Reply With Quote
  #27 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #28 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #29 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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.

Attached Thumbnails
Click image for larger version

Name:	BM-LRstptratioNov10GB.png
Views:	261
Size:	124.1 KB
ID:	4327  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #30 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393


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.

Attached Files
Elite Membership required to download: LRSPTNov10.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on December 1, 2009


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts