NexusFi: Find Your Edge


Home Menu

 





What is your experience in developing and applying signals over Heikin Ashi Charts?


Discussion in MultiCharts

Updated
    1. trending_up 3,329 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 11 posts
    2. attach_file 0 attachments




 
Search this Thread

What is your experience in developing and applying signals over Heikin Ashi Charts?

  #1 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25

Hello everyone,

I'm doing some test by developing some strategies over non regular charts. Specifically I really like Heikin Ashi charts as they provide already an indicator it self for mini trends.
I made a strategy and it really looks fine to me but now I think ( as everyone say " if is's to good to be true, probably it isn't") that I would really technically understand what would be the best practice to have TRUSTABLE backtest using this kind of charts.
For example: Using IOG true in my strategies I have exit and then entries during the same bar and sometimes my signal is able to perfectly follow the flow of waves. Of course the backtest is showing profits almost every end of the day, doing something like 30/35 operation on the MINI DAX future daily (it never goes overnight). Btw my entries are "buy next bar at market" and "sell next bar at open" (that means next tick using IOG true)so I supposed that it almost diffucult to miss an entry or exit.

1) Now... how can I trust the entry and exit point on the chart? In other words, Am I sure that the SUPPOSED entry and exit value are the closest case to the reality?

2) Is multichart considering that buys/sells made at market are made at the worst scenario (buy at bid and sell at ask) possible? Maybe also at the worst "inside bar" value scenario...?

3) Based on your experience what trick shall I use with HEIKIN ASHI charts to OBTAIN trustable entry/exit point and consequently trustable backtest?

I'm curious.. I suppose I'm not the only one who's trying to apply strategies over Heikin Ashi chart... please share your thought suggestions :-D

Regards,

David

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

David,

due to the way Heikin Ashi bars are computed, they don't necessarily reflect the real market prices. So your strategy could show fills at prices that were never traded.
I would suggest comparing the fills that your strategy shows against realtime fills of your strategy on a simulated account to get a feeling of how much this impacts your strategy.

Ways to walk around this problem could be using the Heikin Ashi bars as secondary data stream and doing your executions on a regular bar chart. In case you need intrabar computations based on Heikin Ashi values, you can internally compute the bar values within your strategy out of regular bars and your logic on these "virtual bars" while still executing on regular bar charts.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25



ABCTG View Post
David,

due to the way Heikin Ashi bars are computed, they don't necessarily reflect the real market prices. So your strategy could show fills at prices that were never traded.
I would suggest comparing the fills that your strategy shows against realtime fills of your strategy on a simulated account to get a feeling of how much this impacts your strategy.

Ways to walk around this problem could be using the Heikin Ashi bars as secondary data stream and doing your executions on a regular bar chart. In case you need intrabar computations based on Heikin Ashi values, you can internally compute the bar values within your strategy out of regular bars and your logic on these "virtual bars" while still executing on regular bar charts.

Regards,

ABCTG

Hello Abctg,

Thanks for the clarification. That's really the point that I need to understand: " at what price orders has been filled " (because they has been filled for sure because of the market type of orders).

As a coincidence Just Yesterday I thought about your suggested solution and I already tried to implement the logic of HEIKIN ASHI inside my code. I used exactly those construction formulas:

 
Code
if BarNumber = 1 then begin 
haOpen = open; 
haClose = (O+H+L+C)/4; 
haHigh = MaxList( high, haOpen, haClose); 
haLow = MinList( low, haOpen,haClose); 
end; 

if BarNumber > 1 then begin 
haClose = (O+H+L+C)/4; ////average bar price
haOpen = (haOpen [1] + haClose [1])/2 ; ////avg open/close 1 bar ago
haHigh = MaxList(High, haOpen, haClose) ; ////highest of high,open,close
haLow = MinList(Low, haOpen, haClose) ; //// lowest of low, open, close
After have inserted the above piece of code inside mine then I've changed every O with haOpen and every C with haClose in my code. I left the entries as buy/sell at market and the exit sell/buytocover at open.

After that I've applied the signal to a regular chart but it doesn't work as expected. I still have to figure out why?? (any ideaa?)
As I'm correct with the Heikin Ashi formula inside my code the signal should generate entries the same way and at the same time as it would use an Heikin Ashi chart (even if the signal is applied to a regular candlestick chart). But for some reasons it actually doesn't work....by looking to the chart it seems that the strategy works over the regular chart candles instead of using the "virtual Bars" created inside the code.
I think I'm really missing something but I can't figure out what.... any ideas?

Regards,

David

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

David,

I am afraid I could only guess why your code doesn't work as expected without seeing the full code or knowing what you have been expecting in the first place. I would suggest comparing the Heikin Ashi bar values that you compute within your code to the actual Heikin Ashi bars as a first step.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25


ABCTG View Post
David,

I am afraid I could only guess why your code doesn't work as expected without seeing the full code or knowing what you have been expecting in the first place. I would suggest comparing the Heikin Ashi bar values that you compute within your code to the actual Heikin Ashi bars as a first step.

Regards,

ABCTG

Hello ... just a quick upgrade. At the end I've added a second data on the chart to compare the regular one to the heikin ashia and I discovered that my modifications on the code were correct and the "virtual HA bars" worked as expected. I thought they didn't work because the signal made awful entries and exits compared to the same signal applied only on the HA chart. So it was too terrible to be true at the first look.... but it was correctly working (in a bad way).
Anyway now I discovered How to use both charts at the same time using both features combined into one strategy. This is one thing more learned eh eh

Thanks as always!! :-D

Regards,

David

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

David,

one thing to keep in mind when it comes to back testing strategies with intrabar order generation is the accuracy of the test due to the way MC calculates the code. This link explain it very well and it should give you an idea of how accurate back testing of intrabar order generation strategies can be on "non standard" bar types: https://www.multicharts.com/trading-software/index.php/Intra-Bar_Order_Generation,_Bar_Magnifier_on_Non-Standard_Chart_Types

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25


ABCTG View Post
David,

one thing to keep in mind when it comes to back testing strategies with intrabar order generation is the accuracy of the test due to the way MC calculates the code. This link explain it very well and it should give you an idea of how accurate back testing of intrabar order generation strategies can be on "non standard" bar types: https://www.multicharts.com/trading-software/index.php/Intra-Bar_Order_Generation,_Bar_Magnifier_on_Non-Standard_Chart_Types

Regards,

ABCTG

Thanks for the link, I saw it many times but I still have to "really" understand how those cases apply to the reality.
By using "buy next bar at market" with IOG means by next tick... but what of the four cases will be actually executed?

-------------------------------------------------------------------------------------------------------

Calculation of the “Buy next bar at market” strategy is done as follows:

calculation on the first bar segment (Open) and generation of a market order on Open = Low of the next bar segment.
calculation on the second bar segment (Open-High) and generation of a market order on Open = High of the next bar segment.
calculation on the third bar segment (High-Low) and generation of a market order on Open = Low of the next bar segment.
calculation on the fourth bar segment (Low-Close) and generation of a market order on Open of the next bar.

--------------------------------------------------------------------------------------------------------

Anyway I just want to be sure that I'm doing things on the right way: I have in the same chart window for DAX future both DATA1 chart with regular candlestick and DATA2 chart with heikin ashi candles. The signal is actually triggering the entry/exit based on Heikin Ashi chart candles of data2 BUT the buy and sell order are executed on DATA1 chart as expected. So I can assume that the intrabar order generation along with bar magnifier during backtest are calculated over the DATA1 regular chart. Please correct me if I'm wrong thanks.

Using this trick I should have a strategy tested over normal chart and effective prices as in other words, I'm just using HA data2 chart as an Indicator.


Regards,

David

Reply With Quote
  #8 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

David,

which case you are executed in should depend on segment in which you order was triggered.

Intrabar order generation and the bar magnifier is only available for Data1.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #9 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25


ABCTG View Post

which case you are executed in should depend on segment in which you order was triggered.

ABCTG

This is what I don't understand. In real time I know that my condition can be triggered in any of those cases but what about the backtesting? What are the "system" rules to decide in what segment my market order will be executed? Am sure I'm missing something...


ABCTG View Post

Intrabar order generation and the bar magnifier is only available for Data1.


ABCTG

Ok this is clear.


However I still see some strange behaviour: Sometimes I see the strategy perform an exit inside the same bar where was previoulsly made the entry.

IF for example I made an entry with :

 
Code
some conditions AND ( O of data2 <= C of data2 )
and then I made a similar Exit with
 
Code
  O of data2 >= C of data2
and of course I have IOG true.
I thought that in both conditions it will WAIT for the bar to be completed before say true for ( O of data2 <= C of data2 )[/CODE] and the same for the exit..... but I was probably wrong because testing it in realtime showed a lot of exit and entries in the same bar....
So Can I assume that inside the bar,IOG true (3 minute bar in my case), the C is not considered as the CLOSE of the bar but it is considered as the ACTUAL PRICE? Otherwise I cannot explan the entry/exit inside the same bar...

Regards,

David

Reply With Quote
  #10 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


David,

when it comes to the back testing the segment you are filled will likely depend on the segment that your order is triggered in. This can vary and will depend on your code.

I would suggest using print statements to check what values your code uses at the moment orders are triggered (especially for Close Data2 etc.).

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on April 3, 2018


© 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