I want to use the 1st 1min candle of the open(0930) to use as my opening range. Which ever breaks first that's the direction I would like to take. If the high is broken first then I'd like to take a long position. If the low is broken I'd like to take a short position. My stop loss would be the length of that first candle and my profit target would be two times the opening candle. I'd like the risk to stay constant say $100 and for that to be auto calculated on contracts that need to be purchased based off candle size. I would be trading this on the micro ES. This is a super simple strategy, but I can't figure out how to do it. This would make back test super beneficial especially if I could change the time of the opening range between like the 5 min, 15 min, 30 min, and 1hr to compare the results. I really appreciate any help that can be given. Thank you!!!!!!
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
1 min candle opening range strategy
Collapse
X
-
1 min candle opening range strategy
This is my first post and I hope I'm posting this is the correct place. I've been struggling with the strategy builder and I'm looking for help. Here is what I want my strategy to do.
I want to use the 1st 1min candle of the open(0930) to use as my opening range. Which ever breaks first that's the direction I would like to take. If the high is broken first then I'd like to take a long position. If the low is broken I'd like to take a short position. My stop loss would be the length of that first candle and my profit target would be two times the opening candle. I'd like the risk to stay constant say $100 and for that to be auto calculated on contracts that need to be purchased based off candle size. I would be trading this on the micro ES. This is a super simple strategy, but I can't figure out how to do it. This would make back test super beneficial especially if I could change the time of the opening range between like the 5 min, 15 min, 30 min, and 1hr to compare the results. I really appreciate any help that can be given. Thank you!!!!!!Tags: None
-
Hello dasnakekid,
Thanks for your post and welcome to the Forums!
To detect the first bar of the session, you could create a condition that checks if IsFirstBarOfSession (Misc folder > IsFirstBarOfSession) is equal to True (Misc folder > True).
You could calculate the range within that condition and save the value to a variable.
In another set you could create a condition that checks if the Close price is greater than that variable to detect if the price is moving up.
To detect if the price is moving down you could create a condition that checks if the Close price is less than that variable.
You could check if your strategy is in a Long or Short position using Position (Strategy folder > Current market position) is equal to Long or Short (Strategy folder > MarketPosition > Long/Short) and use Exit methods, such as ExitLongLimit()/ExitLongStopLimit() to place profit target and stop loss orders.
Strategy Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
Conditions: https://ninjatrader.com/support/help...on_builder.htm
Actions: https://ninjatrader.com/support/help...t8/actions.htm
Below is a link to a forum post with helpful information about getting started with NinjaScript.
https://ninjatrader.com/support/foru...040#post786040
I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
https://ninjatrader.com/support/help..._resources.htm
If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
https://ninjatrader.com/support/help...g_concepts.htm
And the MSDN (Microsft Developers Network) C# Language Reference.
https://ninjatrader.com/support/help...erence_wip.htmBrandon H.NinjaTrader Customer Service
- Likes 1
-
Thank you for the help. I will definitely start trying out these and reading and try to learn as much as possible.
side note, if I’m just not able to accomplish this on my own, does ninja trader offer a paid service to have a strategy built for you?
Comment
-
Hello dasnakekid,
Thanks for your notes.
If you need someone to write this script for you on your behalf, you can contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script.
You can search our extensive library of NinjaScript consultants 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!
https://ninjatraderecosystem.com/sea...mming-services
Educators - https://ninjatraderecosystem.com/sea...ures=education
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.Brandon H.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
14 responses
1,789 views
0 likes
|
Last Post
by aligator
Today, 11:47 AM
|
||
Started by Jimmyk, 01-26-2018, 05:19 AM
|
6 responses
837 views
0 likes
|
Last Post
by emuns
Today, 11:27 AM
|
||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,293 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
||
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
13 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
11 responses
63 views
0 likes
|
Last Post Today, 10:08 AM |
Comment