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

Uni Renko Reversal Bar

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

    Uni Renko Reversal Bar

    Hello,
    Should be simple but for some reason I can't get this to make markers on the chart on the correct candles. I've tried high, open, low variations with displacements to single out the candles that show in the attached photo but I can't get the formula correct. A little help is appreciated.

    Using uni renko bars, trying to place a marker on first candle after a wick reversal candle, 6 ticks each, the wick should be at least 3 ticks.

    Thanks!
    Attached Files

    #2
    Hello bsbisme,

    While I don't have any specific information for the unirenko as it is not a default item I can suggest that you use Prints to identify what is happening in your use case. Prints can be added into your conditions to check if they are becoming true when you think they should. If the prints are not working you may need to add prints outside of your condition and print the values you are comparing in the conditions, that will tell you why the condition was not true.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks,
      Then how about the same question but with a range bar.....I want to identify bars where the open is no less that 3 ticks below the close on a 10 tick range bar. Thanks!

      Comment


        #4
        Hello bsbisme,

        To find the difference between two prices you can subtract one price from another. To know if it was more than 3 ticks you would make a condition checking if the amount of difference is greater than 3 ticks worth of price for that instrument.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks. I know it's simple but the formulas I'm trying are not working. I need if (close-3 ticks) >=open OR (close-2) >=open OR (close-1) >= open AND close=high THEN print object. Do I need to use the "arithmetic" section, if so can you guide me as I obviously am not doing it correctly. Many thanks.

          Comment


            #6
            Hello bsbisme,

            If you are manually coding you can just use standard math with the prices, for example:

            double difference = Close[0] - Open[0];

            If we assume the ES is being used and the tick size is 0.25 a condition could be made:

            if(difference >= 0 && difference <= 0.75)

            This would be if the difference between the open and close is less than 3 ticks, it could be 1 2 or 3 ticks below the close. If the close price is higher than the open the resulting difference would be a positive number, for example 2000.50 - 2000 = 0.50 or 2 ticks.

            You can also use math to calculate a number of ticks from a difference by dividing:

            double ticks = difference / TickSize;
            Last edited by NinjaTrader_Jesse; 05-29-2024, 09:05 AM.
            JesseNinjaTrader Customer Service

            Comment


              #7
              How about in strategy builder as I don't manually code. Thanks.

              Comment


                #8
                Hello bsbisme,

                To do this type of math in the strategy builder would require using a custom series, I will outline the steps to do that below. Keep in mind that the builder will be unable to convert the price difference into a number of ticks, that would require manual coding. For this type of condition you would have to figure out how much price difference the amount of ticks you want is and then use that price difference instead of ticks in the condition. For example 4 ticks on the ES would be 0.25 * 4 or 1 so 1 would be the amount of price difference to use in the condition to represent 4 ticks.
                1. In the builder go to the additional data tab
                2. Expand the Custom Series section
                3. Click Add
                4. Name your series and leave its default as type double.
                To set the difference to the series do the following in the conditions and actions screen:
                1. In Set 1 there should be no conditions
                2. In set 1 actions click Add
                3. Select Misc -> Set your series name
                4. Hover the mouse over the series value field and click Set
                5. In the window that appears select Price -> Close
                6. In the properties that appear you will see the offset area, select the minus symbol
                7. Hover the mouse over the 0 value and click Set
                8. Select Price -> Open

                This will subtract the low from the high and assign the value to the series. To use that value in a condition you would do the following:
                1. Create a new condition in set 2 or later by clicking Add
                2. Select the following:
                • Left side: Misc -> Custom series -> leave all the default values
                • Center: lesser equal
                • Right side: Misc -> Numeric value -> Enter the total difference you wanted to check for.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Amazing help, thanks....however, it will not compile. Mind checking the 2 images for me? Thanks again.
                  Attached Files

                  Comment


                    #10
                    Hello bsbisme,

                    From the images I don't see what specifically may be wrong. Can you click view code or does it produce an error? If you can click view code, do that and then try to compile to see if an error is listed.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      I rebuilt it this morning from scratch and it compiled this time. Many thanks for your help. Much appreciated!

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Skifree, 06-17-2024, 06:35 PM
                      3 responses
                      18 views
                      0 likes
                      Last Post Skifree
                      by Skifree
                       
                      Started by sy2023, 09-15-2023, 08:51 PM
                      2 responses
                      234 views
                      0 likes
                      Last Post Crusade12  
                      Started by kiss987, 05-16-2018, 02:19 AM
                      14 responses
                      2,871 views
                      0 likes
                      Last Post bobperez  
                      Started by jalley, 03-22-2021, 12:17 PM
                      4 responses
                      133 views
                      0 likes
                      Last Post bobperez  
                      Started by HGTrader, Yesterday, 02:13 PM
                      6 responses
                      13 views
                      0 likes
                      Last Post HGTrader  
                      Working...
                      X