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

  #1 (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

Working on profit-loss ratio

Before stumbling onto this forum today, I was going to work further on enhancing a simple indicator I have based on the Linear Regression Line. I want to get a better handle on risk versus reward in terms of fine-tuning rules and trading plan.

Right now, the indicator will assume an entry any time the line turns up. As soon as it does so, either a menu-input stop value is applied, or if using a range bar chart (RangeAlt), the stop is placed one tick below the trigger bar.

Then I have a ratio variable and the ability to plot the target based on that ratio. If the Range Bar Chart is 6 ticks, the stop is 8 ticks assuming entry (for longs) one tick above close/high of previous bar and stop 1 tick below the trigger bar. So if the ratio is 1, the target is 8 ticks, if 2 the target is 16 ticks etc.

At first, I just want to have the ability to visually scan to see which ratios tend to work best, but later I want to be able to transfer this into a strategy so that I can start testing stop - to - profit target ratios both with single units and then scaling out multiples.

Right now it also assumes a new position once the first target is hit, thereby emulating multiples and also making it easy to see how often the trigger exceeds the loss-to-profit ratio so you can get a quick sense of whether or not the entries are valid. But the real point of this is not to worry about the entry method all that much - although this one seems pretty good for catching swings fairly quickly for a one-condition entry method - rather to see how many times the profit targets are reached.

The attached chart has a 1-1 ratio of stop to profit target.

Later on, I would like to add in a trailing stop along with an indicator on a lower panel which will keep track of the current risk-reward profile, so that when the stop is moved up the risk goes down making that ratio more favorable. So this is a preliminary attempt at a money-management indicator of sorts.

Ideally, this could be simply written so that one could insert different entry criteria, including random entry which is probably the best way to play with this, but again, entry method is not really what is being worked on here.

So if anyone finds this of interest and wants to accelerate the coding process, feel free. I got pretty good in TS before they cancelled all accounts for Canadians in certain Provinces, and have had a very hard time doing anything in Ninja with a very slow learning curve, it seems.

I am not putting this in the file-sharing area because the intention here is to work on this hopefully until there is a simple strategy that can be used to get good statistical output.

So if anyone has any ideas/suggestions for this idea and/or would like to speed up the coding process, feel free!

Attached Thumbnails
Working on profit-loss ratio-bigmike-lrstops-pts1.png  
Attached Files
Register to download File Type: zip LRLineGaussST.zip (14.0 KB, 51 views)
Reply With Quote
The following 3 users say Thank You to cclsys for this post:
 
  #2 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

cclsys, first, welcome to futures.io (formerly BMT)... I've been <<trying>> to follow your region painting dialogue with NT tech guys... can't help much on the code at this point as I'm barely stumbling along in the mysteries of NS/C# at this point.

Be sure to check out the Psychology and Money Management forum.

There are some very generous, highly skilled folks here... hopefully one of them will get interested in your project and can lend you a hand.

Reply With Quote
 
  #3 (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,
welcome to futures.io (formerly BMT)+ thanks for the post, interesting topic!

i threw the indicator in a chart but i am not shure if i see what you see.
it would help if you give some more infos + first we do a sync of the charts we are looking at.
i tried it in 6B 4 range -- there i have only green Bars - tried diff parameter-settings.
doesnt it work in 6B / 6E ?
i putted it in ES 4 Range trying to copy your settings/view - no luck yet.

so maybe post a chart with only this one indicator in it , give us an instrument + a timeframe + the settings - also what timezone the chart is on - that would be a firts step i think.


looking forward to this .....

max-td

Last edited by max-td; November 2nd, 2009 at 08:16 AM.
Reply With Quote
 
  #4 (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

Hi...I see you're an advanced trader, and I'm just a noob, but I've been thinking about that recently, also, and have decided I like the 3-1 win/loss ratio.

I just happened to have a screenie from this morning. My first 4 trades only had 1 winner, but I'm still up because my w/r ratio is a little above three.

I find it takes a little pressure off me, when I know I only have to be right 1 in 4 trades to break even.

Attached Thumbnails
Working on profit-loss ratio-threetoone.jpg  
Reply With Quote
The following user says Thank You to Jugador for this post:
 
  #5 (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


max-td View Post
hi cclsys,
welcome to futures.io (formerly BMT)+ thanks for the post, interesting topic!

i threw the indicator in a chart but i am not shure if i see what you see.
it would help if you give some more infos + first we do a sync of the charts we are looking at.
i tried it in 6B 4 range -- there i have only green Bars - tried diff parameter-settings.
doesnt it work in 6B / 6E ?
i putted it in ES 4 Range trying to copy your settings/view - no luck yet.

so maybe post a chart with only this one indicator in it , give us an instrument + a timeframe + the settings - also what timezone the chart is on - that would be a first step i think.


looking forward to this .....


First, appreciate the interest

Well, it's just a simple thing based on the LinReg line so it works on all charts - or should. I went through a little learning yesterday about coding for RangeAlt versus Range and suspect I altered the code after posting. It is possible that in the version I posted this is making it not work now on anything except Range charts.

So I post the latest version. I just tested it on Range, RangeAlt and Tick and Minute and it works.

Sorry about that if that was the problem. Now if it still doesn't work for you then I am stumped unless there is some error msg in the log that reveals the problem. If so, I'll just delete all the elements that change when there are Range charts and the stopx level can be input manually (as is now the case for anything other than Range or RangeAlt charts) and away we go.

If it doesn't work, try deleting the portion of the code :

if (Bars.Period.Id == PeriodType.Final1 || Bars.Period.Id == PeriodType.Range)
stopxx = (Bars.Period.Value) +(3); // * 3 because: 1 tick above and 1 tick below bar for the stop, but entry is 1 tick above/below bar so the target is 1 tick more to calculate from the Close when it is triggered.
else stopxx = stopx;

and just write in: stopxx = stopx then I can't imagine why there would be any problem.

stopx is in the Menu panel whereas stopxx is an internal variable I used to handle the two different methods.

The reason I have this deal going with the Range Bars is that
a) I recently started looking at them and
b) the stops will change automatically when you change the Range Bar amount so you don't have to input a manual stop level each time you change the chart.

Again, the idea with this is not so much to get a perfect system but build something simple that helps to test for good risk-reward scenarios.

I stopped monitoring the markets today and will try to expand on this a little but first we have to get some coding that works basically well.

Probably best to make a decision to work with same sort of charts. Since I prefer RangeAlt right now, let's try those? It shouldn't matter which number for the Range.

another problem: maybe you don't have RGaussianFilter on your machine and it wasn't in the package? If so, change the line

if (Gauss)
{lr.Set (RGaussianFilter(LinReg(Period/2),Period/3,4)[0]);} else
lr.Set (LinReg(Period/2)[0]);

to

lr.Set (LinReg(Period/2)[0]);

Attached Files
Register to download File Type: zip LRGaussST2.zip (14.0 KB, 47 views)
Reply With Quote
The following user says Thank You to cclsys for this post:
 
  #6 (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


Jugador View Post
Hi...I see you're an advanced trader, and I'm just a noob, but I've been thinking about that recently, also, and have decided I like the 3-1 win/loss ratio.

I just happened to have a screenie from this morning. My first 4 trades only had 1 winner, but I'm still up because my w/r ratio is a little above three.

I find it takes a little pressure off me, when I know I only have to be right 1 in 4 trades to break even.

First, thanks for interest.
Second, perhaps I shouldn't have put in 'advanced' rather intermediate. I was thinking in terms of time/years, perhaps, since I have traded since the early 80's.

My worst all-time trade: I was short $10,000 worth of OEX puts and SP500 puts worth $65,000 on Friday before the big crash in 1987. I decided not to be greedy and take the money - enough to buy a house in the small town I was in at the time - closing out all contracts 3 minutes before the close.

If I had not made that call, on the open 2 days later those same options were worth over $500,000!! I am not sure I ever recovered from that one!

As to the 3-1 business:

Well, the point of the indicator - which hopefully will soon become a simple strategy - is to visually see very quickly how many times the targets are hit. Right now if it is stopped out and another entry happens (higher high when long), then a second target is drawn, then a third; you can see when that happens with the progression of green target hashes. So very quickly you can see how often the targets are hit and adjust a little by changing the ratio from 1 to 2 to 3 etc.

It might also be a good idea to make the stops and profits targets not just a ratio of each other, but also set in terms of ATR versus a fixed amount. I will try to code that in so that

a) initial risk is a function of market volatility
b) profit target is a ratio of that risk, i.e. .5-1, 1-1, 3-1 etc.

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


cclsys View Post
I have traded since the early 80's.

My worst all-time trade: I was short $10,000 worth of OEX puts and SP500 puts worth $65,000 on Friday before the big crash in 1987. I decided not to be greedy and take the money - enough to buy a house in the small town I was in at the time - closing out all contracts 3 minutes before the close.

I'd call that advanced! Not many guys here can say they've been naked $75,000 bucks worth of puts. I'm sure that was a hell of a margin requirement, too.

Had a decent day maintaining a 3.03 w/l ratio. I only had 5 winners out of 14 trades, but still managed to make about $400. Looking forward to your future posts! Cheers

Attached Thumbnails
Working on profit-loss ratio-3to1.jpg  
Reply With Quote
 
  #8 (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


Jugador View Post
I'd call that advanced! Not many guys here can say they've been naked $75,000 bucks worth of puts. I'm sure that was a hell of a margin requirement, too.

Had a decent day maintaining a 3.03 w/l ratio. I only had 5 winners out of 14 trades, but still managed to make about $400. Looking forward to your future posts! Cheers

'Naked' usually means that you are exposed to unlimited potential loss. At least I think that's what it means..

With options, there is no unlimited risk. So I had ante'd up the money for the puts and had no further risk than the intial 10 G's, which were profits from the previous week.

My system? Trading the 13-bar stochastic crossover which I plotted by hand on chart paper, the numbers for which I got from a $25.00 per month hotline service!

+++++++++

I have changed the indicator to include ATR-related capability but am about to make more changes so won't upload.

The new configuration will have two Modes:

1. Initial stop is Donchian Channel (x)
2. Initial stop is ATR multiple.

The problem I am having is getting the trail stop to work in two different modes. Entry and PT are already fine.

I am also considering Option 3: initial stop is x ticks below trigger bar since this is a quickie momentum system designed to get on board new moves.

Of course, working with only one indicator means that system-wise it's probably a guaranteed loser, but again the ratio is what matters.

I appreciate your 3-1 reports/message and am going to look into it. Since beginning to daytrade I have been tending towards emphasising 70% + success probability but having PT about half the risk and that is what has been hurting me. I would never shoot for that with a long term approach (although my proprietary long term system which uses seasonals bats at around 60% which is quite unusual with long term trend following systems).

So perhaps you have already answered what I am building this indicator to test, and which I was suspecting of late: if you have a 1-2 reward-to-risk ratio, it is very hard to make money even with 70% success rate, especially if you take 3-4 losers in a row and get flustered.

I'll have to make up some formulas to analyse things like that in a spreadsheet, but also would like this indicator to print some of the stats up on the right of the screen so you can quickly see the differences by changing ratios etc. Or even better: output to a spreadsheet though I have never done that in Ninja.

That's tomorrow or next day with any luck... I wish I could code in Ninja!

Reply With Quote
The following user says Thank You to cclsys for this post:
 
  #9 (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


cclsys View Post
'Naked' usually means that you are exposed to unlimited potential loss. At least I think that's what it means..








Sorry...my bad. Usually, when someones talking "options" I tend to correlate "short" with "write", and long positions as "buy" calls or "buy" puts.

But, if I was thinking!...obviously, if you had sold $65,000 worth of puts just before the crash, you would have had to sell your house!

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


Am curious: what sort of stops - PT's are you dealing with in your 1-3 method and which sort of timeframes?

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)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

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 04:44 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-15 in 0.17 seconds with 20 queries on phoenix via your IP 54.234.255.29