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

  #11 (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
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!

No, you are right, that was 'my bad'! I should have written that I was short the market with puts versus short puts. If I HAD been short puts, I would have had to SELL a house!

Reply With Quote
 
  #12 (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
Am curious: what sort of stops - PT's are you dealing with in your 1-3 method and which sort of timeframes?


5 tick stop...16 tick PT (1 extra tick to cover commissions). Today I used a 5 range bar chart on ES emini.

Reply With Quote
 
  #13 (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
5 tick stop...16 tick PT (1 extra tick to cover commissions). Today I used a 5 range bar chart on ES emini.

Thanks. I have been tending to work with markets with around a 10 tick stop, so going for 30 is a bit hard. But then I also didn't research 3-1 as an option. It makes a lot of sense. Tight stop so either you are right and catch a move, or you are wrong and take a small loss.

Reply With Quote
 
  #14 (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
It makes a lot of sense. Tight stop so either you are right and catch a move, or you are wrong and take a small loss.

Yeah, and so I don't get myself into too much trouble, I stop for the day if I'm down about 2% of my account.

So, with a $25,000 account, if I'm stopped out about 8 times ($500), then I'm done for the day.

If I get stopped out 8 times before I catch a couple of winners, it's probably a good idea to stop anyway!

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

Just having started this thread is giving me ideas, although I am not sure how to implement them.

The sense vaguely forming is to start from the money management and build from there versus applying MM to entries (mainly) and exits, i.e. trying to find good entry conditions. Obviously that is important but....

It is quite simple to calculate risk-reward with single units in the sense that whether or not you are trading single or multiple lots they all enter and exit at the same price. It is another thing to figure out good scaling approaches. I suspect this cannot be done without extensive work in terms of recording the MFE on any position (assuming you never exited it until after the MFE happened).

Although I know that scaling works in terms of increasing odds of consistent profitability, I suspect that building on single unit risk-reward is still fine for analysis. Still, there is a BIG difference between going all-in and all-out and then scaling. For example, with your 3-1 approach and assuming 3 units per position:

If your first target is 3* the loss, fine, the rest is gravy.
But if the stop is -5 and Tgt 1 is +6 with BE's at that point, it gets very hard to simply calculate what's going on there risk reward wise.

In any case, this thread has helped me zero in already on realising that I have not approached day trading with the analytical rigor in terms of money management which it deserves and requires. I kept thinking that because I was only trying to scalp quickie moves that all that mattered was coming up with a hot sh*t entry method.

Also, soon after I started Tradestation closed down many Canadian accounts one day out of the blue without warning so I moved to Ninja in which I cannot program and do such analysis easily. That sure hasn't helped!

I have never approached long term design that way in terms of stellar entries. For example, my portfolio system uses a simple moving average with one condition to trade 30 commodities (or more), plus custom-programmed seasonals which are also essentially very simple. That's it. But catching long term trends more than makes up for the stop losses and is, fundamentally, quite easy to do if you have the patience and the funds to do it (which I don't).

My problem now, it seems, is that I don't have the coding ability in Ninja to test entries and find their MFE and MAE from which to analyse scaling versus single unit approaches so I am left with very simple stop and profit target only analysis assuming single units. But at least that's a start to drill down into it.

I suspect I will be spending some time in Market Replay to build up some stats, esp. MFE and MAE. But to make that meaningful I have to clearly set up different types of signals as separate strategies, get very clear on the rules so that when the results are published into a SS they are meaningful.

In terms of this thread, though, the only thing that makes sense is still to shoot for a strategy that can be back-tested in order to get the stats but still to structure the strategy rules so that any optimized inputs emphasise the money-management versus the entry aspect, i.e. keep the entry rules always the same, simply study different risk-reward elements. But an indicator alone is not going to be all that helpful it seems.

So now I will work on transferring my simple indicator into a strategy code and then testing it by mainly only optimizing one parameter: the profit-to-loss ratio. Hopefully I can figure out how to code this since the underlying entry rules are so simple.

Reply With Quote
 
  #16 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


Jugador View Post
Yeah, and so I don't get myself into too much trouble, I stop for the day if I'm down about 2% of my account.

So, with a $25,000 account, if I'm stopped out about 8 times ($500), then I'm done for the day.

If I get stopped out 8 times before I catch a couple of winners, it's probably a good idea to stop anyway!

It's maybe good when you have strong trends, your 16 tick target will be hit, sooner or later.
But in a tight range market ?
Your stops may be hit many times, and you'll never see your target.
To be verified on a chart...

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #17 (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


sam028 View Post
It's maybe good when you have strong trends, your 16 tick target will be hit, sooner or later.
But in a tight range market ?
Your stops may be hit many times, and you'll never see your target.
To be verified on a chart...

Yeah, I'd like to use 2 or 3 ticks as my stop, and go for 7 or 10, but I just don't think that's enough wiggle room.

Reply With Quote
 
  #18 (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, as I always find with Ninja, I just spent three hours trying to code in this ridiculously simple system and can't put in stops and profit targets, get it to exit when the new direction sets up etc. etc. etc. etc. etc.

Would take me about 10-15 minutes in Tradestation.

Compiles nearly all the time, so no hints there as to what I am doing wrong. Will just have to spend a few days on their forum to figure out whatever silly, basic thing it is that I am doing wrong with Ninja Lingo.

Sam, are you really in France? I used to live there, first near Blois, then near Limoges, not to mention several stints in Paris. Speak it well, can't write it though.

Reply With Quote
 
  #19 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


cclsys View Post
Well, as I always find with Ninja, I just spent three hours trying to code in this ridiculously simple system and can't put in stops and profit targets, get it to exit when the new direction sets up etc. etc. etc. etc. etc.

Would take me about 10-15 minutes in Tradestation.

Compiles nearly all the time, so no hints there as to what I am doing wrong. Will just have to spend a few days on their forum to figure out whatever silly, basic thing it is that I am doing wrong with Ninja Lingo.

Sam, are you really in France? I used to live there, first near Blois, then near Limoges, not to mention several stints in Paris. Speak it well, can't write it though.

Easy-Language is made for traders, C# for IT guys...
That's why coding Ninja strategy is not so easy, if you try to do things like your were doing with TS.
The idea is maybe to use a lot of Print("...") , learn how to use IOrder, read the code in some other basic strategy (like this one), or hire a pro.

You can also post your strategy here, with your entries based on a very basic signal (SMA crossover for ex.), so your hyper-smart entry signal will stay private , and then explain how do you want to manage stops/targets.
When a good simple strategy skeleton is made with these bases, adding more smart things is easy...
Their is so many traps in NT strategies, starting slowly with simple things is a good idea...

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #20 (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



sam028 View Post
Easy-Language is made for traders, C# for IT guys...
That's why coding Ninja strategy is not so easy, if you try to do things like your were doing with TS.
The idea is maybe to use a lot of Print("...") , learn how to use IOrder, read the code in some other basic strategy (like this one), or hire a pro.

You can also post your strategy here, with your entries based on a very basic signal (SMA crossover for ex.), so your hyper-smart entry signal will stay private , and then explain how do you want to manage stops/targets.
When a good simple strategy skeleton is made with these bases, adding more smart things is easy...
Their is so many traps in NT strategies, starting slowly with simple things is a good idea...


There is no hyper smart entry strategy. I am just using the slope of the LinReg line - same as the indicator first uploaded here.

I spent today reconfiguring all ATM strategies to be named according to signal type and profit-loss ratio so that I can begin to build statistics in a SS with MFE MAE etc. and also compare different ratios/scaleouts. I would prefer to do this in backtests via a strategy.

If you or anyone else feels like getting it to work, that would be most appreciated and hopefully helpful for others, which is the intention.

To clarify, the intention behind this strategy is to create something that can quickly test profit-to-loss ratio both trading singles and multiples in order to generate some good statistics for analysis. It's not really about an entry technique at all.

I picked the LinReg because it is both fairly smooth and pretty responsive to swing changes. I would never consider it as a stand alone strategy per se, although I have noticed that combining a longer one as a filter often works quite well as a basis for a simple trend-following approach that does not get whipsawed quite as much as the single line alone. I have not tried to develop daytrading strategies on Ninja and prefer to have a few indicators (less and less, frankly). But the problem is that I have been flying blind without the sort of statistical analysis I was used to on Tradestation, albeit mainly I worked with longer term things when coding. So I guess this project is an attempt to start to drill down into daytrading statistics on some level, which is hard to do manually.

If this doesn't work, I shall have to start building a library of trades by running Market Replay regularly or trading more in SIM after the main trading morning real-time trading session in order to build the data for export. But again: being able to run a simple strategy would be best. And of course once you have the template, it is not hard to change the entry conditions to test different types of signal one at a time to get stats on it.

Code attached for both current (useless) strategy and (slightly more helpful but still useless) indicator.

The current strategy is really a mess because I was putting in several things just to try to figure out what was not working. I don't want it to use stops and PT's based in tick numbers input into a menu. The whole point is to have them relate to each other via variables in terms of a profit-to-loss ratio.

There are two ways to set the initial stop: 1 just keys off the Donchian channel wherever it is when the entry is triggered. That is probably the simplest. So whatever the risk is at that point, the profit target(s) are that risk * the risk-reward ratio ('ratio').

The other method is also simple and it just risks a certain multiple of ATR (periodX) and again the PT's are a multiple of that derived from the risk-reward ratio, and the same for any additional units in terms of scaling.

Hope that makes sense. It seems much simpler to think than to write out! The whole thing is supposed to be very simple, actually, not complicated at all.

Attached Files
Register to download File Type: zip AshTest1.zip (10.1 KB, 27 views)
Register to download File Type: zip LRGaussST2.zip (16.4 KB, 26 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 07:05 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-11 in 0.16 seconds with 20 queries on phoenix via your IP 54.92.194.75