Working on profit-loss ratio - NinjaTrader Programming | futures io social day trading
futures io futures trading


Working on profit-loss ratio
Updated: Views / Replies:7,506 / 39
Created: by cclsys Attachments:28

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 28  
 
Thread Tools Search this Thread
 

Working on profit-loss ratio

  #21 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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
Working on profit-loss ratio-lrbackcolor.png  
Attached Files
Register to download File Type: zip LRLTtrans.zip (6.5 KB, 33 views)
Reply With Quote
 
  #22 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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
Working on profit-loss ratio-bigmike-lrltstpt1.png   Working on profit-loss ratio-bigmikegcvolbarpatt-bettervol2.png  
Attached Files
Register to download File Type: zip LRstopsPTratio1.zip (16.4 KB, 42 views)
Register to download File Type: zip BetterVolume2b.zip (12.6 KB, 37 views)
Register to download File Type: zip BarPatterns1.zip (12.7 KB, 37 views)

Last edited by cclsys; November 8th, 2009 at 09:59 PM. Reason: clarification; inclusion of BetterVolume2b
Reply With Quote
The following 3 users say Thank You to cclsys for this post:
 
  #23 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received


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

Reply With Quote
 
  #24 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

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

Last edited by max-td; November 9th, 2009 at 05:32 AM.
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #25 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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
Working on profit-loss ratio-bmpfminimal.png  
Reply With Quote
 
  #26 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

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
Register to download File Type: cs LRStopPTRatio1_mx.cs (25.2 KB, 13 views)
Register to download File Type: cs LRLineLTtrans_mx.cs (16.1 KB, 13 views)
Register to download File Type: cs LRGaussST2_mx.cs (23.9 KB, 11 views)

Last edited by max-td; November 10th, 2009 at 11:51 AM.
Reply With Quote
 
  #27 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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.

Reply With Quote
 
  #28 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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.

Reply With Quote
The following user says Thank You to cclsys for this post:
 
  #29 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received

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
Working on profit-loss ratio-bm-lrstptrationov10gb.png  
Reply With Quote
 
  #30 (permalink)
Elite Member
Sydney, NS
 
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Zen-Fire
Favorite Futures: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 379 received


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
Register to download File Type: zip LRSPTNov10.zip (16.5 KB, 28 views)
Reply With Quote

Reply



futures io > > > > > Working on profit-loss ratio

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyLanguage Daily Profit and Daily Loss limit in strategy Big Mike EasyLanguage Programming 11 May 12th, 2016 02:50 PM
Gold/Dow 1:1 ratio; what say you? researcher247 Commodities Futures Trading 1 March 26th, 2011 01:14 AM
Gold to Silver Ratio martifc Commodities Futures Trading 10 January 25th, 2011 10:15 AM
Set Profit and Loss Variables brightredmegaphone NinjaTrader Programming 20 December 10th, 2010 07:21 PM


All times are GMT -4. The time now is 10:32 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-10 in 0.23 seconds with 20 queries on phoenix via your IP 54.221.73.186