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 14,768 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

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

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
Click image for larger version

Name:	BigMike-LRStops&PTs1.png
Views:	448
Size:	58.8 KB
ID:	4045  
Attached Files
Elite Membership required to download: LRLineGaussST.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
  #2 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

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)
 
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,
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
Reply With Quote
  #4 (permalink)
Jugador
USA
 
Posts: 162 since Jul 2009
Thanks Given: 67
Thanks Received: 51

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
Click image for larger version

Name:	threetoone.jpg
Views:	294
Size:	249.0 KB
ID:	4052  
Reply With Quote
Thanked by:
  #5 (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


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
Elite Membership required to download: LRGaussST2.zip
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #6 (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


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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
Jugador
USA
 
Posts: 162 since Jul 2009
Thanks Given: 67
Thanks Received: 51


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
Click image for larger version

Name:	3to1.jpg
Views:	260
Size:	249.3 KB
ID:	4055  
Reply With Quote
  #8 (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


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!

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
Jugador
USA
 
Posts: 162 since Jul 2009
Thanks Given: 67
Thanks Received: 51


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


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

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