Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HeikenAshiBarsType calculatet based on UniRenkoBarsType

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

    HeikenAshiBarsType calculatet based on UniRenkoBarsType

    Hi, I would like to use the UniRenkoBarsType as a price basis for the calculation of the HeikenAshi bars, unfortunately these are not listed in the selection. I suspect that a new *BarsTypes.cs has to be created. Unfortunately, I have no idea how to proceed. Is there perhaps a template or even a ready-made BarsType.cs? In the NinjatraderEcosystem I only found the HeikenAshi8 indicator, but since this is an indicator, and I like to have everything as a unique barstype, this does not help me.

    Click image for larger version

Name:	Screenshot_1.jpg
Views:	309
Size:	42.5 KB
ID:	1168074Click image for larger version

Name:	Screenshot_2.jpg
Views:	281
Size:	29.7 KB
ID:	1168075
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    Thanks for your post.

    The reason for the Heiken-Ashi indicator is to be able to use it on exotic bar types.
    I suspect you may not understand how to use the indicator.
    The indicator will provide 4 values that you can use in your programming.
    HAClose
    HAOpen
    HAHigh
    HALow

    Those are the names of the plots and you can access any or all four the same as if you were using standard bar data.

    For example: if (HAClose[0] > HAOpen[0]) { // do something }

    For input to an indicator, you can use it like this SMA(HAclose, 20)[0]; // 20 period SMA based on the Heiken - ashi close price.

    To further assist I've created an example strategy that creates a private instance of the Heiken-Ashi indicator and an EMA indicator. This provides you with a specific example of how to use the indicator in both the bar data and as an input to an indicator. When applied to a chart of unirenko bars they then are the input to the Heiken-ashi indicator, thus meeting the need you specified of Unirenko input to Heiken-ashi.


    Here is a screenshot of the example strategy:

    Click image for larger version  Name:	sidlercom80-2.PNG Views:	6 Size:	45.2 KB ID:	1168087



    Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

    Note — To import NinjaScripts you will need the original .zip file.

    To Import:
    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
    2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.

    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'


    HeikenAshiExample.zip
    Last edited by NinjaTrader_PaulH; 08-17-2021, 11:57 AM.

    Comment


      #3
      Hi _PaulH, thank you very much for your answer, that helped me very well.
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      592 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X