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!
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
NinjaTrader
ninzaRenko Wicks
Collapse
X
-
Hello surya,
Thanks for your message.
You can reference the OHLC values of the bar to see if High is greater than the Open/Close or the Low is less than the Open/Close to see if a wick is formed on the bar.
To reference a previous bar, you would use a BarsAgo index of 1.
I.E.
Code:if ((High[1] > Open[1] && Open[1] > Close[1]) || (High[1] > Close[1] && Close[1] > Open[1])) Print("High wick found on previous bar at" + Time[0])
If you are using the Strategy Builder, please see the information below for creating strategies with the Strategy Builder.
Strategy Builder 301 (publicly available resource) — https://www.youtube.com/watch?v=_KQF2Sv27oE
Conditions examples —https://ninjatrader.com/support/help...on_builder.htm
Actions examples — https://ninjatrader.com/support/help...us/actions.htm
We look forward to assisting.Last edited by NinjaTrader_Jim; 06-14-2021, 07:38 AM.JimNinjaTrader Customer Service
- Likes 1
-
Comment
-
Hello surya,
As it affects our ability to address other client inquiries in a timely manner, we would not be able to schedule a one-on-one session involving a NinjaScript Development or Debugging inquiry.
I suggest using prints to better see how BarsAgo indexing works and how strategies process data when Calculate.OnBarClose is used, and when OnEachTick/OnPriceChange is used. For example, you can print Misc > CurrentBar, Price > Close with BarsAgo 0 and BarsAgo 1, and Time > TimeSeries to see bar indexes, values and timestamps. You can then also enable the data box on your chart, and if you right click in the data box, you can enable bar indexes and bars ago indexes which you can compare against the NinjaScript Output window.
Prints can be added under Actions > Misc in the Strategy Builder.
Realtime data will process the developing bar when Calculate is set to OnPriceChange/OnEachTick. (BarsAgo 0 I.E. Close[0] would be the developing bar) Historical data will follow Calculate.OnBarClose behaviors regardless of the calculate mode, unless Tick Replay is used. (BarsAgo 0 I.E. Close[0] would be the bar that had just closed.)
Bar closures are signaled when the next bar starts developing, so when we look at the previous bar with BarsAgo 1, I.E. Close[1], and we submit an order when that trigger bar closes, the order would then be submitted and would be filled with the data after that bar.
Please let us know if you have any additional questions.
JimNinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_Jim View PostCode:if ((High[1] > Open[1] && Open[1] > Close[1]) || (High[1] > Close[1] && Close[1] > Open[1])) Print("High wick found on previous bar at" + Time[0])
It was picking up every bar with a wick.
I think it needs a wick distance judgement to only catch bigger wicks thanks
Comment
-
Did you test live on simAccount on the renko bar, before going live. Remember on Backtesting that you trigger you exit or even entry, but the backtest uses the Open of the Next bar, so slippage is a big deal in back testing. I use a brick base bar and the results on live sim is the only real test. Backtesting will not be close
you could test in Play Back Connection too
Comment
-
Hello ezrollin,
Renko bars have issues with backtesting because of their behavior to repaint the open of a bar with realtime processing. With historical processing/backtesting, the bars are already formed.
Some custom Renko bars aim to get past this but should use High Order Fill Resolution or submit orders to a single tick data series for accurate fill prices. (Since backtesting uses the OHLC of each bar to fill orders, and does not have any tick per tick movement for processing logic or filling orders.)
I suggest starting with the information below on differences between historical and realtime processing which are especially important for Renko bars. Playback can also help simulate realtime data for testing Renko strategies. If you have additional questions involving backtesting, please do not hesitate to open a new thread.
Discrepancies between realtime and backtest - https://ninjatrader.com/support/help...ime_vs_bac.htm
As for the example condition, I get the attached results that show that there missing prints where there was no high wick on the previous bar.
JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Vikuno1, 11-28-2023, 11:42 PM
|
13 responses
345 views
1 like
|
Last Post
by PaulMohn
Today, 01:45 PM
|
||
Started by Taddypole, 04-26-2024, 02:47 PM
|
5 responses
35 views
0 likes
|
Last Post
by eDanny
Today, 11:49 AM
|
||
Started by kujista, 04-23-2024, 06:23 AM
|
6 responses
51 views
0 likes
|
Last Post Today, 11:42 AM | ||
Started by giulyko00, 04-24-2024, 12:03 PM
|
7 responses
37 views
0 likes
|
Last Post
by eDanny
Today, 11:35 AM
|
||
Started by NM_eFe, Today, 10:13 AM
|
0 responses
12 views
0 likes
|
Last Post
by NM_eFe
Today, 10:13 AM
|
Comment