I have made a strategy to go long and short according to the colour change of Renko bars. Now I need to filter it with N bars up and down indicators. I want my strategy not to place any order when there is no vertical lines in both N bars up and Down indicators. I need some help with that please.
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
Need help with Strategy Building
Collapse
X
-
Need help with Strategy Building
Hi,
I have made a strategy to go long and short according to the colour change of Renko bars. Now I need to filter it with N bars up and down indicators. I want my strategy not to place any order when there is no vertical lines in both N bars up and Down indicators. I need some help with that please. -
Hello asmmbillah,
Welcome to the forums!
The NBarsUp and NBarsDown indicators can be referenced for NinjaScript usage in our help guide.
Checks for n number of consecutive higher closes. Returns a value of 1 when the condition is true or 0 when false.
Parameters
barCount - The number of required consecutive higher closes
BarUp - Each bar's open must be higher than the close; true or false
higherHigh - Consecutive higher highs required; true or false
higherLow - Consecutive higher lows required; true or falseCode:// Checks if we have 3 consecutive higher closes double value = NBarsUp(3, true, true, true)[0]; if (value == 1) Print("We have three consecutive higher closes);
If you have not already, I would also recommend viewing the Strategy Wizard 301 tutorial for a complete walkthrough for creating a strategy with this tool.
Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBiNYsf1e8
NBarsUp and NBarsDown indicators can be referenced below.
NBarsUp - https://ninjatrader.com/support/help.../n_bars_up.htm
NBarsDown - https://ninjatrader.com/support/help..._bars_down.htm
Please let us know if you have any questions.JimNinjaTrader Customer Service
-
Hi,
Thanks for your reply.
I have read the materials in the links and watched the video. My question is, I want my strategy to place order when green bars changed into red, but not to place any new orders if there is no bars shown on N bars up and down indicators. If you could help me with any example pls.
Comment
-
Hello asmmbillah,
Thanks for your reply.
Creating trading logic as well as creating modifying and debugging client code exceeds the scope of service we can offer in the support department. This is because we are a small team and cannot take on the bandwidth to fulfill these requests for all of our clients. If you are looking for such services, I can have a representative of our EcoSystem write back with additional information on NinjaScript Consultants who would be happy to create this strategy or any piece of logic desired for your needs.
To answer your question, you may consider the following:
A green bar is created when the Close is greater than the Open and a red bar is created when the Close is less than the Open. You could set a bool when Close > Open and then when the Close is less than open and this bool is true, you then know bars have changed from green to red.
You could also create logic checking a certain number of bars ago to see if they were red or green to further define your logic.
For example, the current bar is red and the last two bars are green: Close[0] < Open[0] && Close[1] > Open[1] && Close[2] > Open[2]...
This logic could set a bool that you can use alongside a bool for "if there is no bars shown on N bars up and down indicators" to control your order entries.
I've included an additional document that goes further into detail on barsAgo references.
Working with Price Series - https://ninjatrader.com/support/help...rice_data2.htm
Please let us know if we can provide further assistance.JimNinjaTrader Customer Service
Comment
-
Hi,
Thanks again. yes, if you could let advise one of Echosystem representative to contact me with details of Ninjascript consultant would be very helpful.
Comment
-
Hello asmmbillah,
Thank you for contacting us and for your interest in NinjaTrader!
You can search our extensive library of vendors who provide programming services through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!
You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.
This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.Ryan L.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by arvidvanstaey, Today, 02:19 PM
|
2 responses
7 views
0 likes
|
Last Post Today, 03:12 PM | ||
Started by jordanq2, Today, 03:10 PM
|
0 responses
5 views
0 likes
|
Last Post
by jordanq2
Today, 03:10 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
46 views
0 likes
|
Last Post Today, 02:36 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
6 views
0 likes
|
Last Post Today, 02:12 PM |
Comment