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,516 / 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

  #31 (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, Mode 3 in and that's it. This mode uses the Stopx from the Menu Panel, i.e. if Stopx is 8, then the initial stop is 8 ticks. All is working fine and now it is easy to quickly see the sort of ratio of stops to profit targets that works with any market. No matter what sort of entry system one has, nevertheless the market is going to be pretty much the same in terms of what sort of profit-to-loss ratio works based on how much it backs and fills. Unless you have a method that is so good at picking entries just before things lift off that you hardly ever get stopped out. Possible of course, but..

Attachments:

LRSTPTRatio3
Picture of Mode 3 on Soy RenkoSbS chart from today showing good and bad periods, some with multiples getting all targets hit, others getting chewed up with only stop being hit and not even #1 tgt exiting. And some with #1 then pullbacks etc. Very easy to see very quickly with this indicator. Which is the point at first. Later on, stats would be far more helpful (MFE, MAE, % tgt 1 hit etc.)

7.44 EST: re-uploaded indicator code which now has the ability to change opacity in the menu panel properly.
751 EST: just remembered why it wasn't in menu panel before: something to do with the line plots and opacity: you can't change them. You can in the code and then you have to reload the indicator but you cannot on the chart. So it's fixed again and that is that. Opacity is now in the menu panel but should not be used.

Attached Thumbnails
Working on profit-loss ratio-bm-ltstnov10-soyrenkosbs.png  
Attached Files
Register to download File Type: zip LRSTPTRatio3.zip (16.7 KB, 19 views)

Last edited by cclsys; November 10th, 2009 at 08:52 PM.
Reply With Quote
 
  #32 (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

Nope, that wasn't it.

Having spent time improving it, it is better and I just spent a while looking through various mkts and timeframes and found a few things not working satisfactorily.

So: have changed the way it plots the targets and also made all targets plot immediately the 'signal' is triggered. In addition, have added a fourth target in different color (red), the idea being that generally you want to be able to have the third target get most of the typical move and not see too many red targets on a screen since that means the levels are getting unrealistic.

I might try later to assume that a final contract - i.e. a runner - trails until stopped out and put a moving PT that tracks a certain amount above the current run high (or below run low) to give visual confirmation of what sort of gains those runners can make, but one can see this already and that is not really the point of this indicator which is more concerned with risk reward of the typical movement including losers and normal winners.

So it is really working well, now, I think, and I am already finding it helpful in terms of figuring out what sort of stops and Pts to have in different timeframes or chart types.

I looked at 744 ES tick chart today and found with this indicator that entries with 3 tick stops will do pretty well. Since I have been using 8 tick stops when I traded that market. Now probably this is a little unrealistic in terms of speed of chart, fills etc., but maybe not. The chart is not that fast - 1-2 mins per typical bar - and the ES is liquid.

So that was interesting and something the indicator made MUCH easier to study precisely and rapidly.

Attachment: #4 (same name in code, writes over old one)
Picture of ES 744 tick.

(Why 744? Multiple of megalithic yard measurements which relate to geomantic lines on Earth! Actually, its supposed to be 732. 366 is root number I think. Megalithic yards multiply exactly into degrees around the planet. A little change from Fibs.)

Attached Thumbnails
Working on profit-loss ratio-bm-1110-es744.png  
Attached Files
Register to download File Type: zip LRSTPTRatio4.zip (16.8 KB, 39 views)
Reply With Quote
The following 2 users say Thank You to cclsys for this post:
 
  #33 (permalink)
Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: IB
Favorite Futures: ES
 
Jugador's Avatar
 
Posts: 163 since Jul 2009
Thanks: 67 given, 51 received


I think you're going over everybody's head here, man.

Reply With Quote
 
  #34 (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

Yeah, probably. But as I work to get this 'indicator' functioning clearly, I can see that at some point I can port it into a strategy template to get statistics. The main point now is to quickly eyeball what sort of risk-reward levels work in which sorts of markets/timeframes. It is already handy that way. I am hoping to be able to put the ratios into a Custom ATM strategy at some point to use in SIM to get real-time stats, and not be restrained by taking indicator-based signals which this code uses for sake of simplicity and having something to base entries on. Right now, it gives very quick visual feedback (with the target lines) on a chart depending on r-r settings so it is already helpful - at least for me if not many others!

Reply With Quote
 
  #35 (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 have been tracking this for a couple of days and also adding capabilities, including stats showing current RR ratio etc. In adding these things, some aspects are not working right but I am already finding it helpful in keeping the money management aspect front and centre in the approach. I don't like using smoothed indicators for signals, but they are the only thing I can easily program to create entry conditions. But the stop and PT plots which dynamically adjust - especially in ATR-based mode - I am finding very helpful in determining the advisability of a trade

Here is a chart pic showing the new stats window that is still being worked on, along with entry triangles that aren't quite right yet but are designed to display during the current bar at a limit price based on a volatility band condition (i.e. you don't want to enter when the price has already run away too far).

Attached Thumbnails
Working on profit-loss ratio-bm-1113-sysstats1.png  
Reply With Quote
The following 4 users say Thank You to cclsys for this post:
 
  #36 (permalink)
Just starting out...
Seffner, FL
 
Futures Experience: Master
Platform: NinjaTrader
Broker/Data: Vision Finacial
Favorite Futures: es
 
Posts: 1 since Nov 2009
Thanks: 1 given, 0 received

I'd be interested in taking a closer look at this. Could you describe your current indicators and parameters? I may be able to offer some thoughts (or maybe not, lol).

Thanks,

Jamie

Reply With Quote
 
  #37 (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


jhall1962 View Post
I'd be interested in taking a closer look at this. Could you describe your current indicators and parameters? I may be able to offer some thoughts (or maybe not, lol).

Thanks,

Jamie

Well, the indicator is in previous posts.

Here is the current edition which still has problems but is getting better.

Mode 2 is not right (ATR) though it is the one I prefer.

I tried putting together Modes 1,3 and 4 today and messed up a well-working Mode 1 but stopped coding work.

As to parameters: it is designed to test different risk-reward settings and display them on the chart so you can play with them yourself.

There is a problem with the different IndyMethods, but 1 and 2 work fine (lin Reg and ZeroLagEMA).

Mode1: Uses Donchian Channel Stops.
Mode2: ATR value stops
Mode3: Hard stop from stopx in Menu Panel
Mode4: Range of entry bar with attempt to see Range Bars
Mode5: (if it's in this version) continuous plots of stops and PT's every bar. Messy but doesn't depend on any entry/exit method, although it does use the lines for trend so as not to have to plot in both directions every bar.

The ATRmulti input (for use with Mode 2) is for determining the ATR initial stop, after which the Ratio input calculates the profit targets as it does in all Modes.


If you read through the code and descriptions and just play with the inputs it's pretty easy.

Again, the point is to show what the targets are based on the risk from the method. Of course one could have a different method or much lower risk than the 'system' is recommending, but with this template you can code in different ideas.

But you can quickly see on a chart how far you have to go in order to maintain a 1.5 or 2 reward-to-risk ratio and see how realistic that is. You can also tell by how often the targets and backcolors reverse from long to short the degree of whipsaws.

So if you have 1-1 risk-reward and only hitting target about half the time, you are definitely going to be losing money, even assuming you occasionally hit a big winner and ride it all the way and don't exit early, aren't trading enough contracts etc. But if your PT's are so far away in a 1-3 risk-reward setting that they hardly ever get hit... or then you can try tightening the stops with the manual stop (Mode 3) and see if that works better. One win with 1-3 ratio will make back 3 losers.

The indicator assumes 1 tick slippage on entry and calculates that into the PT.

There are two types of signal: initial trend (colorup/colordown in Visual part of Menu) and pullback/retracement/reentries after being stopped out (color2up/color2down). The triangles show the setup bar so that when tracking in live action you get a heads-up. The entry is assumed to be where the triangle is for PT/stop calculation but in reality it could be different of course. But again, the main thing is not the system, per se, but having risk-reward plots to eyeball a whole chart and get a sense, by playing around, with what sort of ratios are reasonable in what sort of market.

What would be helpful at this point is to improve the stats so that they keep track of winners and losers, average win, average loss, MFE, MAE etc.

Which is why it is going to be best to put this into a strategy ASAP in order to get the stats more easily. I am just not able programming-wise to put something like this into a Ninja Strategy, as simple - basically - as it is. I have just not found any coding samples to help me get started since it seems people hang on to strategies and only share indicators.

It's actually harder to code something like this into an indicator but I just don't know the strategy lingo yet.

On the positive side, it is easier to monitor during live action or Market Replay with an indicator and use it for discretionary training along with keeping in mind the risk-reward ratio which is really what this one is about. The method itself is unimportant (and not all that good). But bar by bar it spits out stops and profit targets based on the Ratio, and that gives perspective no matter what entry or stop approach you use in actual trading. That's the point of this.

Attached Thumbnails
Working on profit-loss ratio-bm-1114-indicmenuratiosys.png  
Attached Files
Register to download File Type: zip 1114_RatioSysBand.zip (32.7 KB, 32 views)
Reply With Quote
 
  #38 (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

Two steps forward, one back. Every time I get something working right, I go onto the next thing and have to spend a lot of time figuring that out and then something from earlier doesn't work again. Much harder to do this on an indicator than in a strategy. But it should be working well in all modes by next week.

Meanwhile, I tried putting in entry triggers that have nothing to do with indicators and keyed off Barry Taylor's BetterVolume2 which is my basic always-have-on-the-chart thing.

Quite surprising. Although some arrows depend upon a high or low being penetrated, the triggers themselves are based purely on various combinations of the patterns and not all that tricky to code. Once I get the patterns set, will add in the stops and profit targets, but at first sight, this looks promising. I like very much that the entries are not based on indicators, but there are not so many triggers meaning it is not so helpful in following the markets live in order to train more in getting the risk-reward ratios effective.

Anyway, here is picture of the initial 2-3 patterns including one that uses the LowVolume Bar which I have tended to ignore. That pattern caught some big moves within a few ticks of the lows/highs (on the tick charts I usually load, not the attached one - gray arrows). Perhaps a coincidence and something that won't work consistently but in eyeballing charts a few days back they seem to be pretty good. First time I really paid attention to them. They indicate that basically stops are being rather quickly run through on light volume and, seemingly, often anticipate a new shift in direction since that sort of thing often happens before a new thrust. Not always, of course, but often 'they' run the stops to flush out any new and light players in a newly developing scenario to clean them out before taking off on heavy volume somewhere else.

The attached pic is of the 5 min chart - which I personally don't follow- but it picked out several winning trades in a row, although again it is not all that active. The first two around the open at 8.15 and then later after 9.00 had about 1 point heat ($100.00) or less, and 2-5 pts possible. Then only 1.5 pts, then about 100 ($1000) - that one a picture perfect Brooks H2 off a ClimaxChurn bar (red).

So when I have a couple more patterns and have put in the stop and profit target plots based on RR ratio (which is customisable and that's the whole point of this indy), I'll upload it.

Attached Thumbnails
Working on profit-loss ratio-bm-1115-gc-volpatts.png  
Reply With Quote
The following user says Thank You to cclsys for this post:
 
  #39 (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

Update: I got ahead of myself with this one and am going to start over from scratch with the same basic idea but just working with Renko bar reversals, and Range/others using Donchians. That way I'll get rid of the indicator entry condition and the pullback options. That will leave it with more clear-cut money-management analysis/training capabilities.

As to the volume indicators, I have been working steadily on them and have too many now. After I have observed them for a week or two more, will publish something in Elite zone.

Reply With Quote
 
  #40 (permalink)
Elite Member
Dallas,TX
 
Futures Experience: Intermediate
Platform: NinjaTrader, OpenQuant
Broker/Data: Zaner/Zen Fire
Favorite Futures: ES,6E,6B,GC,CL
 
Posts: 590 since Nov 2009
Thanks: 176 given, 116 received


do we have this in a Strategy now to backtest in Ninja?

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 05:30 AM.

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-13 in 0.16 seconds with 20 queries on phoenix via your IP 54.92.194.75