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

Need help with Renko on 5min TF

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

    Need help with Renko on 5min TF

    Hi,

    I need to set up my data series with renko chart, brick size as 0.1 and 5 min TF. I want my EMA crossover to run on the renko series .I have gone through the help document and found I need to use the below

    AddRenko(string instrumentName, int brickSize, MarketDataType marketDataType)
    and
    BarsPeriod.Value


    can some one post me an example on how can my task can be achieved.

    Thanks,
    Vamsi

    #2
    AddRenko(Instrument.FullName,2, MarketDataType.Last); //My minimum tick is 0.05 hence took 2 for 0.1
    Add(PeriodType.Minute,5);//I think this might refer to regular candles in 5 min TF. I want to create 5min tf on renko
    What will be the series number for Renko 5 min? For 1 min regular candle it is 0 and 5 minute regular candle it is 1

    Comment


      #3
      Hello thenvk,

      Thank you for your note.

      To add a bar series of type renko you could use the following,

      Code:
      AddRenko(string instrumentName, int brickSize, Data.MarketDataType marketDataType)


      Used in an example on US Steel with a 5 brick size,
      Code:
      AddRenko("X", 5,MarketDataType.Last);
      The primary series (the chart) will be Bar Series 0, and with just one Renko Series added, the Renko would be the 2nd series or Bars in Progress 1.

      Please see BarsInProgress,


      As well as the multi series script sample at the link below,


      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Thank you. Can you also tell me with a sample code how to add the 5 minute data series of the renko chart. Once this 5 min renko is added, the bar series index will be 2, if my understanding is correct.
        regular chart index 0, renko 1 minute index is 1 and now when we add 5 minute series does it create 5 minute series of both Regular and renko is it? then how to know the index of 5 min renko?

        Also instead of hard coding the instrument name, if I use AddRenko(Instrument.FullName,2, MarketDataType.Last); the script will automatically pick the current instrument is it?

        Comment


          #5
          Hello thenvk,

          You should hardcode the symbol and not use Instrument.FullName, see the third note at the following link on hardcoding,



          I provided the statement to add a Renko bar series in the previous post. You could swap this out with the AddDataSeries call in the sample strategy I also provided.

          Regarding adding additional data series and how the strategy knows the index, please see the following links which will get you familiar with multi series scripts.






          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Thank you Alan.I am using ninjatrader 7. I did go through the links you provided and I am still confused on the adding 5 min series for Renko.

            I understood that
            Code:
            AddRenko("X", 5,MarketDataType.Last);
            will add the renko 1 minute series.

            Adding
            Code:
            Add(PeriodType.Minute,5);
            will add 5 minute data series for both renko and also for normal candles series too?

            Please provide me the input on how to add 5 minute renko please.

            Then in that case will I have 4 data series all together.

            Comment


              #7
              Hello thenvk,

              A renko chart does not take a time input such as 5 minutes, they are non time based. I suggest doing an internet search for Renko Bars.

              You could add a 5 minute series and also a renko series, but each are different series and would be added separately and referenced on their own.

              The add renko statement would be the same in NT7,


              Please let us know if you need further assistance.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Hi @NinjaTrader_AlanP,

                Thank you. You have been very helpful. More questions.

                1. How can I plot bars/indicators on the chart for the second renko series that I have added?. I am fine not to see the first series too.
                2. If I use( Sample code)
                Code:
                if (BarsInProgress ==1) {
                EMAfast crossabove EMAslow}
                will the system calculate the EMA on the second series or do I need to use it as below code again to calculate ema on second series
                Code:
                if (BarsInProgress ==1) {
                EMAfast[1] crossabove EMAslow [1] }
                3. Could you please point me to a simple renko chart indicator. I dont see one available in Ninja

                Thanks,
                Vamsi.

                Comment


                  #9
                  Hello thenvk,

                  See the following link, under “Using Bars Objects as Input to Indicator Methods”, for passing a secondary series to an indicator.



                  The following reference sample demonstrates how to set a plot to an indicator series.


                  From the sample code you provided, EMAFast[1] would refer to 1 bar ago in the EmaFast series, not necessarily a secondary series. The two links I provided above should provide clarity.

                  For example, to set the EMA of a secondary series to the first plot,

                  Code:
                  Values[0].Set(EMA(BarsArray[1], Period)[0]);
                  Renko is a bar type. Indicators you could apply to a renko chart you could apply to a candlestick chart or a bar chart, for example SMA.

                  Please let us know if you need further assistance.
                  Alan P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,604 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post Javierw.ok  
                  Working...
                  X