NexusFi: Find Your Edge


Home Menu

 





repaint, heikin ashi, profit factor


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one micasa001 with 3 posts (0 thanks)
    2. looks_two JonnyBoy with 1 posts (1 thanks)
    3. looks_3 Fat Tails with 1 posts (4 thanks)
    4. looks_4 TheShrike with 1 posts (0 thanks)
    1. trending_up 3,446 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 2 attachments




 
Search this Thread

repaint, heikin ashi, profit factor

  #1 (permalink)
 micasa001 
Amsterdam
 
Experience: Master
Platform: Own
Trading: Currency
Posts: 9 since Jul 2017
Thanks Given: 4
Thanks Received: 1

Hi,

In NT8 I have created a new strategy based on Heikin Ashi candles. Now I get profit factors between 4 and 6 on 1 hour durrations (crypto, specified pairs). I have some questions for this:

- I have the feeling this profit factor is too high. Any others have similar results sometimes?
- Is it possible that the default HA is repainting? And is there a solution to resolve this?

Best regards

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
OrderFlow-Based Support/Resistance Levels
Emini and Emicro Index
MC PL editor upgrade
MultiCharts
Quantum physics & Trading dynamics
The Elite Circle
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
Funded Trader platforms
21 thanks
Trading with Intuition
17 thanks
ApexTraderFunding.com experience and review
12 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #2 (permalink)
 
JonnyBoy's Avatar
 JonnyBoy 
Montreal, Quebec
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: Kinetick
Trading: ES
Posts: 1,561 since Apr 2012
Thanks Given: 706
Thanks Received: 3,858


micasa001 View Post
Hi,

In NT8 I have created a new strategy based on Heikin Ashi candles. Now I get profit factors between 4 and 6 on 1 hour durrations (crypto, specified pairs). I have some questions for this:

- I have the feeling this profit factor is too high. Any others have similar results sometimes?
- Is it possible that the default HA is repainting? And is there a solution to resolve this?

Best regards

Have you read this?

https://backtest-rookies.com/2018/01/26/backtrader-working-heikin-ashi/

--------------------------------------------------------
- Trade what you see. Invest in what you believe -
--------------------------------------------------------
Reply With Quote
Thanked by:
  #3 (permalink)
 micasa001 
Amsterdam
 
Experience: Master
Platform: Own
Trading: Currency
Posts: 9 since Jul 2017
Thanks Given: 4
Thanks Received: 1




Thank you JonnyBoy, let me have a check for these codes and test it.

Started this thread Reply With Quote
  #4 (permalink)
 
TheShrike's Avatar
 TheShrike 
Bridgeport, Ct
 
Experience: None
Broker: Tasty
Trading: Fops
Posts: 533 since Jun 2012
Thanks Given: 1,588
Thanks Received: 923


micasa001 View Post
Hi,

In NT8 I have created a new strategy based on Heikin Ashi candles. Now I get profit factors between 4 and 6 on 1 hour durrations (crypto, specified pairs). I have some questions for this:

- I have the feeling this profit factor is too high. Any others have similar results sometimes?
- Is it possible that the default HA is repainting? And is there a solution to resolve this?

Best regards

"Artificial" bar types like heikin ashi and renko are notorious for skewing backtest results. Be very careful.

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

Standard renko bars and heikin ashi bars are not backtestable with NinjaTrader. This can be easily explained.

Attached is a chart with an example. Let us assume that the long breakout bar in the middle of the chart triggers a long signal and that your strategy enters with a market order. I have labeled the breakout bar "signal bar", because it triggers the signal. For the purpose of a backtest NinjaTrader will then enter a long position at the opening price of the next bar, which is labeled "entry bar".

And here is the problem. Just for the purpose of looking beautiful, Heikin Ashi bars use an artificial opening price, which is the arithmetic mean of the opening price for the prior bar, and the (hidden) opening price of the current bar. The first transaction price for the entry bar is 2765.25. However, the Heikin Ashi open is shown as 2760.25 calculated as the arithmetic mean of the (real) opening price of 2765.25 and the heikin ashi open of the prior signal bar at 2755.25.

For the backtest NinjaTrader uses the fake open of 2760.25. The backtest now accounts for a fake profit of 5 points, as the real entry price would have been 2765.25. However, you won't get that profit in real life. It is just obtained by drawing the bar open.






There are lots of fancy bar types that suffer from the same restriction. Basically the question you need to ask is whether the price bar chosen correctly represents the prices of all transactions that took place during the time while that bar was plotted. Or does the bar plot something else?

Let us take a standard renko bars. Renko bars plot false opening prices, false highs and false lows. What does that mean? On a renko chart you cannot find the daily high and the daily low. You will never know, because the renko bars do not show it. As the bar open of a Renko bar is a fake open, you may never run a backtest on a renko chart, if you enter or exit with market orders.

Heikin Ashi bars have a displaced open and a fake close. Most of the lows of all upclose bars and most of the highs of the downclose bars are also fake, as real low and high are replaced with the heikin ashi open. What do you expect from a backtest, if you enter fake data?

Don't even think about backtesting renko bars, heikin ashi bars, range no gap bars or three line break bars. They do not represent price action. They are just designed for making you happy, but not for making you money.

Some of those bar types can be modified to become backtestable. Attached is a chart comparing a standard renko bar with a backtestable renko bar.






If you wish to run a backtest, you would need to select a bar type that is backtestable. Bar types that show the real open, high, low and close are typically backtestable.

Bar types that print a fake open, fake high, fake low or a fake close are not backtestable.

Life is simple.

Reply With Quote
Thanked by:
  #6 (permalink)
 micasa001 
Amsterdam
 
Experience: Master
Platform: Own
Trading: Currency
Posts: 9 since Jul 2017
Thanks Given: 4
Thanks Received: 1

Thank you for the detailed explanation. Does this not make HA bars totally useless? Then why would HA bars be used when the results are distorted?

Started this thread Reply With Quote




Last Updated on March 5, 2020


© 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