NexusFi: Find Your Edge


Home Menu

 





UniRenko, Universal Renko Bar Type


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one MWinfrey with 27 posts (120 thanks)
    2. looks_two Tasker_182 with 27 posts (83 thanks)
    3. looks_3 jmcg618 with 21 posts (2 thanks)
    4. looks_4 Big Mike with 20 posts (54 thanks)
      Best Posters
    1. looks_one monpere with 33.4 thanks per post
    2. looks_two dstrader with 8 thanks per post
    3. looks_3 MWinfrey with 4.4 thanks per post
    4. looks_4 Tasker_182 with 3.1 thanks per post
    1. trending_up 426,484 views
    2. thumb_up 1,698 thanks given
    3. group 227 followers
    1. forum 695 posts
    2. attach_file 122 attachments




 
Search this Thread

UniRenko, Universal Renko Bar Type

  #551 (permalink)
 gdstuart 
Hammonton NJ
 
Experience: Beginner
Platform: NinjaTrader
Broker: NT Continuum
Trading: Indexes (Indices?)
Posts: 101 since Nov 2014
Thanks Given: 164
Thanks Received: 71


xplorer View Post
Hi guys

I wonder if you can help me.


I have created a NT7 NinjaScript Strategy that places a marker above my UniRenko bars when a certain condition is met - the condition being two consecutive bars in an uptrend must have a wick sloping upwards by one tick. The reverse is true for downtrend.

@xplorer,

I'm on vaca so can't test this, but it looks to me like your fifth line of logic doesn't match your specification. Why are you multiplying by TickSize in the expression? If you're looking for a simple tick trend, then take off the "*TickSize" argument.

I also have one question about your spec: what do you want to see if the up or downslope is greater than one? You're only testing for a slope difference of exactly one.

Try this and re-post please.

Geoff

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #552 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,944 since Sep 2015
Thanks Given: 15,447
Thanks Received: 15,291

Hi there Geoff - thank you for the reply, pls. see below


gdstuart View Post

I'm on vaca so can't test this, but it looks to me like your fifth line of logic doesn't match your specification. Why are you multiplying by TickSize in the expression? If you're looking for a simple tick trend, then take off the "*TickSize" argument.

I suppose the reason to use TickSize was because that's what you can select via the Wizard interface. Perhaps it's also quicker if you want to apply this to any instrument rather than coding the tick increment by hand every time?

Anyway I have just amended the code by removing the TickSize and replacing it with + or - 0.01 (1 tick increment on CL) - the code works ok but the anomaly is still present, on exactly the same bar. In other words, I see no difference from the previous version of the strategy. I am a bit stumped.


Quoting 
I also have one question about your spec: what do you want to see if the up or downslope is greater than one? You're only testing for a slope difference of exactly one.

Yes, you are right. I am not expecting to see anything in particular really - this is my very first attempt to use NinjaScript so I see this as more of an exercise in trying to understand its usefulness than anything else.


But I am puzzled as to why what I had expected to be a relatively simple code would sometimes not work.

Reply With Quote
  #553 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,944 since Sep 2015
Thanks Given: 15,447
Thanks Received: 15,291



xplorer View Post
Hi guys

I wonder if you can help me.

[...]


Have I created the conditions incorrectly, or do you reckon it's something else?

There's another thing that bugs me about this:

The condition that validates if there's a tick difference in an uptrend between current and previous bar reads

Low[0] == Low[1] + 1 * TickSize

but, if the current bar is marked as [0] and "1 bars ago" is marked as [1] (and not [-1] as I thought), shouldn't the condition read something like

Low[0] + 1 * TickSize == Low[1] ?

I.e. if the bar with [1] is the preceding bar and the bar currently being tested is [0], then the lower tick should be at the bar numbered [1], right?


And yet it seems to currently work.


Unless I'm completely misreading NinjaScript syntax.

Reply With Quote
  #554 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525


xplorer View Post
There's another thing that bugs me about this:

The condition that validates if there's a tick difference in an uptrend between current and previous bar reads

Low[0] == Low[1] + 1 * TickSize

but, if the current bar is marked as [0] and "1 bars ago" is marked as [1] (and not [-1] as I thought), shouldn't the condition read something like

Low[0] + 1 * TickSize == Low[1] ?

I.e. if the bar with [1] is the preceding bar and the bar currently being tested is [0], then the lower tick should be at the bar numbered [1], right?


And yet it seems to currently work.


Unless I'm completely misreading NinjaScript syntax.

Those are not equivalent expressions.

The equivalent expressions are:

if (Low[0] == Low[1] + TickSize)

if (Low[1] == Low[0] - TickSize)

I am curious as to why you are putting all this into a strategy and not an indicator ?

Also, make sure you have the following check at the top of your OnBarUpdate()

if (CurrentBar < 1) return;

I looked at your code logic, and was not able to figure out why that one bar in the example didn't have a marker on it. It has been reported some versions of UniRenko have a one tick inaccuracy in the high/low price of the tail of reversal candles. Meaning the highest high (or lowest low) tail is off by one tick. Looking at your chart example, the candle pattern in question meets this criteria, so you may have run into this bug.

Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #555 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,944 since Sep 2015
Thanks Given: 15,447
Thanks Received: 15,291

Thank you very much trendwaves



trendwaves View Post
Those are not equivalent expressions.

The equivalent expressions are:

if (Low[0] == Low[1] + TickSize)

if (Low[1] == Low[0] - TickSize)

Please can you clarify what you mean by 'Those are not equivalent expressions'?



Quoting 
I am curious as to why you are putting all this into a strategy and not an indicator ?

Being a NinjaScript noob, I just found a YouTube video about alerts and it went via the strategy route. I didn't know better.


Quoting 
Also, make sure you have the following check at the top of your OnBarUpdate()

if (CurrentBar < 1) return;

Please can you explain what this does?


Quoting 
I looked at your code logic, and was not able to figure out why that one bar in the example didn't have a marker on it. It has been reported some versions of UniRenko have a one tick inaccuracy in the high/low price of the tail of reversal candles. Meaning the highest high (or lowest low) tail is off by one tick. Looking at your chart example, the candle pattern in question meets this criteria, so you may have run into this bug.

I suspected it might be the case, but wouldn't the one-tick inaccuracy also show up in the data box (the one you get when you middle-click on a bar)? Whereas if I look at the data in there it checks out ok.


And of course that leads to the question: are you aware of which UniRenko bars may not have this bug?

Reply With Quote
Thanked by:
  #556 (permalink)
 Grantx 
Reading UK
Legendary no drama Llama
 
Experience: None
Posts: 1,787 since Oct 2016
Thanks Given: 2,826
Thanks Received: 5,058

I found 'Sim22_UniRenkoV1', for NT8 but Id like to know if anyone else has had success with loading and using it? Or if there is another download somewhere that I should use instead.
Thanks.

Visit my NexusFi Trade Journal Reply With Quote
  #557 (permalink)
 
michaelf's Avatar
 michaelf 
Mérida, Mexico
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage
Trading: MNQ
Frequency: Daily
Duration: Minutes
Posts: 559 since Mar 2011
Thanks Given: 1,432
Thanks Received: 581


Grantx View Post
I found 'Sim22_UniRenkoV1', for NT8 but Id like to know if anyone else has had success with loading and using it? Or if there is another download somewhere that I should use instead.
Thanks.

I use this one, it is from the NinjaTrader Forum and made by NinjaTrader_ChelseaB.
Unfortunately I can't find that post again.

Attached Files
Elite Membership required to download: UniRenkoBarsType.zip
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #558 (permalink)
 Grantx 
Reading UK
Legendary no drama Llama
 
Experience: None
Posts: 1,787 since Oct 2016
Thanks Given: 2,826
Thanks Received: 5,058


michaelf View Post
I use this one, it is from the NinjaTrader Forum and made by NinjaTrader_ChelseaB.
Unfortunately I can't find that post again.

Thank you Michael.

Visit my NexusFi Trade Journal Reply With Quote
  #559 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,944 since Sep 2015
Thanks Given: 15,447
Thanks Received: 15,291

@trendwaves

I think I figured out some of the things you said


Quoting 
Please can you clarify what you mean by 'Those are not equivalent expressions'?

By 'equivalent expression' you mean that A = B + 1 is an equivalent expression but B + 1 = A is not, right?




Quoting 
if (CurrentBar < 1) return;

Please can you explain what this does?

Thanks for this. I looked it up and understand that it may cause problems if there is only one bar available.

Reply With Quote
Thanked by:
  #560 (permalink)
 Grantx 
Reading UK
Legendary no drama Llama
 
Experience: None
Posts: 1,787 since Oct 2016
Thanks Given: 2,826
Thanks Received: 5,058



xplorer View Post
Hi guys

I wonder if you can help me.


I have created a NT7 NinjaScript Strategy that places a marker above my UniRenko bars when a certain condition is met - the condition being two consecutive bars in an uptrend must have a wick sloping upwards by one tick. The reverse is true for downtrend.

Being relatively new with NinjaScript I have gone via the wizard and these are the conditions




Set 1: up bars

The first two conditions ensure that the bars have wicks by checking if the open is different from the low on both bars.

The next two conditions check if both are up bars

Set 2: down bars

These sets are just the opposite of Set 1 for down bars

The result required is that a diamond marker is printed on the second bar if the first and second bars have wicks that differ by 1 tick up or down according to trend direction.


As you can see from the screenshots below, the conditions appear to work in most cases. However there are a few instances where they do not work (last screenshot)


In the screenshot above all the markers show up as expected


In this screenshot a marker (where the red and green arrows point) is missing.

It appears to me that the two bars that don't work in the screenshot have all the elements of the conditions (two down bars, two wicks, High on first bar is 49.06 and High on second bar is 49.05) and therefore should have a marker, but it does not show up.


I looked up this thread for specific issues or comments about wicks or tails but I didn't find anything that was relevant.


Have I created the conditions incorrectly, or do you reckon it's something else?


Thank you

Xplorer what are those dots on your chart at the swing points and how do you use them in your trading method?

Sent using the nexusfi.com mobile app

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on April 3, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts