Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Get BarColor of HeikenAshi

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get BarColor of HeikenAshi

    Hi!

    I was searching a long time before I wrote this message.

    I want to get the color of the last candle in HeikenAshi (also for a normal candle). The only help I found was: "just look what data get to the green candle". But that doesnt helped me. Because I cant find the place in the sourcecode where the candle is colored. I cant even find the word "green" in the whole sourcecode...

    It would be nice to work with an indicator without analyzing the whole sourcecode in detail, because sadly I dont have much time.... The most important output of the HeikenAshi is the color of the candle and there should be an easy solution for it?

    Thank you for any help in advance!

    #2
    Hello,

    Thank you for the question.

    There is a post that describes the syntax used for this here: http://ninjatrader.com/support/forum...ad.php?t=72004

    Essentially you are not checking the color but the condition of prices. The HeikenAshi already does this, so you would need to check against the indicator plots as the example shows.

    If you will be using the Primary instrument, you can substitute the examples "Input" with Close instead or:

    Code:
    if(HeikenAshi(Close).HAClose[0] > HeikenAshi(Close).HAOpen[0])
    {
    	Print("Up");
    }
    Additionally if you wanted the Last candle, you would need to use a Bars ago, or replace the [0] with [1] or:

    Code:
    if(HeikenAshi(Close).HAClose[1] > HeikenAshi(Close).HAOpen[1])
    {
    	Print("Up");
    }
    Because all indicators are in essence just code, creating custom conditions like checking the HeikenAshi would require some research into the original code in order to know what to do. In this case the syntax is pretty simple but depending on the ideas you have it may become more complex.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    4 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    40 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X