Ninja back test: real or fake - NinjaTrader | futures io social day trading
futures io futures trading


Ninja back test: real or fake
Updated: Views / Replies:2,833 / 20
Created: by mcteague Attachments:0

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
 
Thread Tools Search this Thread
 

Ninja back test: real or fake

  #1 (permalink)
Elite Member
New York NY USA
 
Futures Experience: Beginner
Platform: esignal, ninjatrader,
Favorite Futures: Stocks
 
Posts: 110 since Oct 2012
Thanks: 54 given, 29 received

Ninja back test: real or fake

I was testing a simple strategy using ninja trader. I ran it 3 times for the period 1/1/2008 till today.
The only change I made was in the target I used for the test. The trade criteria was exactly the same.

4 point target had 1033 trades with 49% profitable
2 point target had 1358 trades with 61% profitable
1 point target had 1651 trades with 73% profitable

All had a 2 point stop.


Why would the number of trades be different? All back tests used the same strategy. The only change was to the target.
Would I be wrong to conclude that Ninja trader is not actually back testing? That is it is not using real data. But that it is testing with randomly generated data.

That would be very disappointing, since that is not what back testing means. Is there some reason the trade numbers might be different that I am not considering? Thanks

Reply With Quote
 
  #2 (permalink)
Trading Apprentice
PA/USA
 
Futures Experience: Master
Platform: Independent Trader, TS
Broker/Data: RJO/CQG
Favorite Futures: Equity Index
 
Posts: 6 since Apr 2014
Thanks: 4 given, 11 received

The smaller the target, the shorter your trade. The shorter your trade, the more opportunity for new entries to be taken.

If you set your target to 10000 points, you'd have only one trade (or only one trade per day, if you're exiting at the close).

Make sense?

Reply With Quote
The following 4 users say Thank You to Mathemagician for this post:
 
  #3 (permalink)
Elite Member
New York NY USA
 
Futures Experience: Beginner
Platform: esignal, ninjatrader,
Favorite Futures: Stocks
 
Posts: 110 since Oct 2012
Thanks: 54 given, 29 received



Mathemagician View Post
The smaller the target, the shorter your trade. The shorter your trade, the more opportunity for new entries to be taken.

If you set your target to 10000 points, you'd have only one trade (or only one trade per day, if you're exiting at the close).

Make sense?


As far as I know the back test does not wait for a trade to be closed before proceeding to the next trade. I am not testing this on only one instrument, like the ES.
I have a list of about 120 stocks that I am testing using EOD data.

This is a very simple system.

Reply With Quote
 
  #4 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Master
Platform: ninjatrader, r-trader
Favorite Futures: CL, NG, TF, NQ, YM, GC, ES
 
liquidcci's Avatar
 
Posts: 862 since Jun 2011
Thanks: 609 given, 1,051 received

Just realize there can be limitations with backtesting. After you backtest it is advisable to go through large sample of your trades to check and see if any problems. Not all strats backtest well and can give you false results. I will not trade a strat unless backtest and live results match very closely and I have a understanding of any issues.

"The day I became a winning trader was the day it became boring. Daily losses no longer bother me and daily wins no longer excited me. Took years of pain and busting a few accounts before finally got my mind right. I survived the darkness within and now just chillax and let my black box do the work."
Reply With Quote
The following 3 users say Thank You to liquidcci for this post:
 
  #5 (permalink)
Elite Member
Israel
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: pfg
Favorite Futures: eminis
 
Posts: 323 since Jun 2009
Thanks: 6 given, 206 received


mcteague View Post
As far as I know the back test does not wait for a trade to be closed before proceeding to the next trade. I am not testing this on only one instrument, like the ES.
I have a list of about 120 stocks that I am testing using EOD data.

This is a very simple system.

What do you mean
Quoting 
As far as I know the back test does not wait for a trade to be closed before proceeding to the next trade.

Can't you look and see.
There is a parameter for this.
I wouldn't start with only 120 stocks. Start with 5000 at least. lol

Reply With Quote
The following user says Thank You to baruchs for this post:
 
  #6 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary


mcteague View Post
As far as I know the back test does not wait for a trade to be closed before proceeding to the next trade. I am not testing this on only one instrument, like the ES.
I have a list of about 120 stocks that I am testing using EOD data.

This is a very simple system.

Take a look at your logic. If you are already long, will the strategy open a brand new trade? Or, will it ignore subsequent signals, since you are already long?


You could also post the code (take any "secret sauce" out), and people could tell you exactly why you are seeing this behavior.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:
 
  #7 (permalink)
Elite Member
New York NY USA
 
Futures Experience: Beginner
Platform: esignal, ninjatrader,
Favorite Futures: Stocks
 
Posts: 110 since Oct 2012
Thanks: 54 given, 29 received

I think ninja as a limit of 200 stocks per list. So testing 5000 would be difficult. These are just things that are within a certain price range and trade 1 ( or maybe 2) million on average per day.

There really isn't any secret sauce. This strategy is not intended for automated trading. Its purpose is to help me better understand how well certain indicators work, and to get some idea of whether I am on the right path regarding my trading. This is pretty much just a scan that I do for stocks on the close. But I would actually weed out a lot from the results I get. I certainly would not trade them all.

But I just do not have the skill necessary to place all the subjective criteria I might use, like price line to choppy, into the strategy. So I am simply looking for a general sense of whether this setup is trade-able
Originally I was thinking of this like being the house in Las Vegas. A 60% profitable rate would yield a 2 trade profit for every 10 trades. But I realize it is a little more complicated than that, as there are other factors.

Anyway as I said there is no secret sauce. It is pretty basic and simple. It is unlikely I have found the secret to crushing the street.

{
SetProfitTarget("", CalculationMode.Ticks, 100);
SetStopLoss("", CalculationMode.Ticks, 200, false);

CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(PPO(12, 26, 9), PPO(12, 26, 9).Smoothed, 1)
&& PPO(12, 26, 9)[0] > Zero
&& ATR(14)[0] < Onepfine
&& PPO(12, 26, 9)[1] < PPO(12, 26, 9).Smoothed[1]
&& PPO(12, 26, 9)[2] < PPO(12, 26, 9).Smoothed[2])
{
EnterLong(DefaultQuantity, "");


* Onepfine means 1.5
I was really trying to find out the value of having my PPO crosses above or below zero or minus 1.
Again all I did was change the profit target and got totally different numbers of trades. So I am not sure what that means. Thanks to all for replies.

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
PA/USA
 
Futures Experience: Master
Platform: Independent Trader, TS
Broker/Data: RJO/CQG
Favorite Futures: Equity Index
 
Posts: 6 since Apr 2014
Thanks: 4 given, 11 received

I could be wrong, but I still believe your code is skipping entry signals when already in a trade. This is the default behavior of every trading platform I know.

For example, if you're already long 100 IBM and get another buy signal that second buy signal would be ignored. However, if you tighten your target on that trade you are more likely to be out of the first trade by the time the second signal arrives, so the second signal is less likely to be ignored.

The tighter your target, the more likely you are to be flat when the next signal arrives.

The looser your target, the more likely you are to already be in a trade when the next signal arrives, causing the later signals to be ignored.

Hence, more trades for tighter targets.


Last edited by Mathemagician; May 28th, 2014 at 05:21 PM.
Reply With Quote
The following user says Thank You to Mathemagician for this post:
 
  #9 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,860 since Jun 2009
Thanks: 480 given, 3,255 received

If you want to be able to enter a new position while already in a position, you need to set "Entries per direction" to be more than 1 (the default)

Strategy.EntriesPerDirection

One problem with backtesting this is if you are targeting 1pt and your ATR is, say 5pts, then you will almost always have a winner. If you are also using a stop and your stop is also 1pt and the day bar went up at least 1pt as well as down at least 1pt during that bar, it will be counted as a loser because Ninja doesn't know if it hit the target or stop first (within the bar) so it just treats it as a loser (or winner, can't remember, either way the results are not reliable). Make sure your stops and targets are greater than some multiple of ATR of the timeframe being traded. Or, place your orders on a smaller, secondary timeframe (like 5mins) within the day bars, if you have access to that data (more complicated to code too).

P.S. You can backtest on more than 200 instruments at a time but it might be really slow, especially if you are connected to a real-time data feed while you are backtesting.

Reply With Quote
The following 2 users say Thank You to shodson for this post:
 
  #10 (permalink)
Elite Member
New York NY USA
 
Futures Experience: Beginner
Platform: esignal, ninjatrader,
Favorite Futures: Stocks
 
Posts: 110 since Oct 2012
Thanks: 54 given, 29 received



shodson View Post
If you want to be able to enter a new position while already in a position, you need to set "Entries per direction" to be more than 1 (the default)

.

Thanks for explaining this. that could certainly explain the difference in the number of entries. I also appreciate the explanation of how back testing results can be falsely affected by the way I lay out my stops and targets. That was very interesting.

It just seems to me that since we have these tools we should try to find out what our setups and indicators are really worth. That is pretty much all I am trying to do. When a trend indicator like MACD, PPO, or TSI cross their signal lines how reliable is that as a trading signal? What does it really mean? These kinds of indicators are the easiest examine this way. So that is where I am starting. I think even people not interested in automated trading should try and test their setups to see whether they have any real chance of making money.

Again thanks for the "number of entries" explanation. I just did not know.

Reply With Quote

Reply



futures io > > > > Ninja back test: real or fake

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
Back test line break charts mrticks NinjaTrader Programming 19 October 21st, 2013 04:20 PM
So is there anyway to back test acuratley and reliably? jeronamo Elite Automated NinjaTrader Trading 2 May 6th, 2013 06:22 AM
How to back test in Ninja dandxg NinjaTrader Programming 3 August 26th, 2012 01:21 PM
How do you back test a pattern? Tiger45 The Elite Circle 4 March 13th, 2012 09:06 PM
back test sam028 Terms (Glossary) 0 June 28th, 2010 07:20 PM


All times are GMT -4. The time now is 05:25 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-17 in 0.15 seconds with 19 queries on phoenix via your IP 54.163.210.170