NexusFi: Find Your Edge


Home Menu

 





Exit strategy at change of color heiken ashi bar


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one OWLTC with 3 posts (1 thanks)
    2. looks_two thailerdurden with 2 posts (1 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 trendwaves with 1 posts (3 thanks)
      Best Posters
    1. looks_one trendwaves with 3 thanks per post
    2. looks_two Fat Tails with 1 thanks per post
    3. looks_3 thailerdurden with 0.5 thanks per post
    4. looks_4 OWLTC with 0.3 thanks per post
    1. trending_up 5,497 views
    2. thumb_up 6 thanks given
    3. group 6 followers
    1. forum 8 posts
    2. attach_file 1 attachments




 
Search this Thread

Exit strategy at change of color heiken ashi bar

  #1 (permalink)
 OWLTC 
Around the corner
 
Experience: Intermediate
Platform: ninjatrader
Trading: forex
Posts: 4 since Oct 2015
Thanks Given: 2
Thanks Received: 1

Hi All,

nice to meet so many dedicated people and share the same passion! :-)

This is my first thread and question

Does any one know how i can exit a trade automatically when a heiken ash bar color changes?
Your help and input would be very much appreciated!

Best regards
OWL

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
Quant vue
Trading Reviews and Vendors
MC PL editor upgrade
MultiCharts
 
  #3 (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


Trading is not like playing with slot machines. The question how to enter or exit a position when "the color changes" is not very professional. Also you should not try to access color objects in NinjaTrader, but rahter access the underlying condition.

A color change of a Heikin Ashi bar may signal a change in the underlying trend. Now you did not specify which version of the Heikin Ashi bars you intend to use. Let me assume that you use standard NinjaTrader Heikin Ashi bars. In that case there are 3 different color states

- upclose: close > open
- downclose: close < open
- doji: close = open

You can check for these conditions via the strategy builder.

I have coded an enhanced version of the HeikinAshi indicator, which you can find here:



The indicator has the trend (uptrend or downtrend) exposed as a BoolSeries. You can access this BoolSeries directly via code. However, the strategy builder cannot access the BoolSeries, but would require a DataSeries object instead.

I do have a modified version which has the BoolSeries replaced with a DataSeries. The DataSeries can hold the value + 1 (for uptrend) and - 1 (for downtrend), and it can be directly accessed via the strategy builder. So all you would need to do is to check for a change of that value. Please let me know, if you wish to use the modified version of the indicator, and I will post it.

Reply With Quote
Thanked by:
  #4 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525

Assuming your using NinjaTrader (?), and also assuming you would be creating a strategy to do this automatically (?) for you....

To access the default NinjaTrader "HeikenAshi" indicator "bar" open and close values you would use these public accessors....

HeikenAshi().HAOpen[0]

HeikenAshi().HAClose[0]

so a "color change" from Green to Red might look like...

if ((HeikenAshi().HAClose[0] < HeikenAshi().HAOpen[0]) && ( HeikenAshi().HAClose[1] >= HeikenAshi().HAOpen[1]))
{
ExitLong();
}

Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 OWLTC 
Around the corner
 
Experience: Intermediate
Platform: ninjatrader
Trading: forex
Posts: 4 since Oct 2015
Thanks Given: 2
Thanks Received: 1


Fat Tails View Post
Trading is not like playing with slot machines. The question how to enter or exit a position when "the color changes" is not very professional. Also you should not try to access color objects in NinjaTrader, but rahter access the underlying condition.

A color change of a Heikin Ashi bar may signal a change in the underlying trend. Now you did not specify which version of the Heikin Ashi bars you intend to use. Let me assume that you use standard NinjaTrader Heikin Ashi bars. In that case there are 3 different color states

- upclose: close > open
- downclose: close < open
- doji: close = open

You can check for these conditions via the strategy builder.

I have coded an enhanced version of the HeikinAshi indicator, which you can find here:

The indicator has the trend (uptrend or downtrend) exposed as a BoolSeries. You can access this BoolSeries directly via code. However, the strategy builder cannot access the BoolSeries, but would require a DataSeries object instead.

I do have a modified version which has the BoolSeries replaced with a DataSeries. The DataSeries can hold the value + 1 (for uptrend) and - 1 (for downtrend), and it can be directly accessed via the strategy builder. So all you would need to do is to check for a change of that value. Please let me know, if you wish to use the modified version of the indicator, and I will post it.

Hi Fat tails,

Thank you for replying to my question. Indeed i might not come across professional just because i am not professional.
I am also very rusty on my C++, C# is new. So therefor i can only appreciate your reply even more, thank you.

Also thank you for the indicator to download and the tip on the BoolSeries, i will try them both.

OWL

Started this thread Reply With Quote
  #6 (permalink)
 OWLTC 
Around the corner
 
Experience: Intermediate
Platform: ninjatrader
Trading: forex
Posts: 4 since Oct 2015
Thanks Given: 2
Thanks Received: 1


trendwaves View Post
Assuming your using NinjaTrader (?), and also assuming you would be creating a strategy to do this automatically (?) for you....

To access the default NinjaTrader "HeikenAshi" indicator "bar" open and close values you would use these public accessors....

HeikenAshi().HAOpen[0]

HeikenAshi().HAClose[0]

so a "color change" from Green to Red might look like...

if ((HeikenAshi().HAClose[0] < HeikenAshi().HAOpen[0]) && ( HeikenAshi().HAClose[1] >= HeikenAshi().HAOpen[1]))
{
ExitLong();
}

Hi Trendwaves,

Thank you for your reply and information. I very much appreciate that you have taken the time to educate me and to show how it would be written. Indeed i am using ninjatrader, sorry to mention that. Your clarification is very educational and can't wait to try to implement it. Thank you!

OWL

Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
thailerdurden
san antonio, tex
 
Posts: 79 since Nov 2014
Thanks Given: 17
Thanks Received: 33

"....enter or exit a position when "the color changes" is not very professional."

I thought the color changes gave a very good clue. Two red bars after a series of green bars looked like they gave a good sell signal.

So what am I missing here? Do the colors change after the fact? As in, the color will be dependent on the next bar?

I've just starting looking at the heikin ashi, not even sure how to spell it.

Reply With Quote
  #8 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


thailerdurden View Post
"....enter or exit a position when "the color changes" is not very professional."

I thought the color changes gave a very good clue. Two red bars after a series of green bars looked like they gave a good sell signal.

So what am I missing here? Do the colors change after the fact? As in, the color will be dependent on the next bar?

I've just starting looking at the heikin ashi, not even sure how to spell it.

this is how bar color changes

Attached Thumbnails
Click image for larger version

Name:	2015-11-14_1024.png
Views:	224
Size:	56.0 KB
ID:	197638  
Reply With Quote
  #9 (permalink)
thailerdurden
san antonio, tex
 
Posts: 79 since Nov 2014
Thanks Given: 17
Thanks Received: 33

heikin ashi close = average of high low close open of current standard candlestick bar or hi low open close bar

heikin ashi open = average of close and open of last heikin ashi bar

so the heiken ashi close value depends on what just happened in the current period

and the heikin ashi open value depends of what happened on the last period.

Thus a heikin ashi bar is not dependent on the future period?? In short, it is not cheating. Reason I asked, is I had a spread sheet formula that showed a fantastic profit loss result. What happened was I was using the current hi low values to put a position on at the open.

Hell, then why not sell at the high and buy at the low since I knew at the open what the high and low was going to be?

Reply With Quote
Thanked by:




Last Updated on November 14, 2015


© 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