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

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:	258
Size:	42.5 KB
ID:	1168074Click image for larger version

Name:	Screenshot_2.jpg
Views:	230
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.
    Paul H.NinjaTrader Customer Service

    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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X