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
Entering at Median Price
Collapse
X
-
Entering at Median Price
In Strategy Builder I am attempting to enter a medial price instead of bid, ask or close but even though the strategy is a simple crossover of two average, it skips 90%of orders. Is there a way to fix this ? Also I am entering using limit ordersTags: None
-
Hello Teebone21,
Thanks for your question.
It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.
You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.
We look forward to assisting.JimNinjaTrader Customer Service
-
Originally posted by NinjaTrader_Jim View PostHello Teebone21,
Thanks for your question.
It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.
You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.
We look forward to assisting.
Comment
-
Originally posted by NinjaTrader_Jim View PostHello Teebone21,
Thanks for your question.
It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.
You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.
We look forward to assisting.
Comment
-
Hello Teebone21,
I have included a demonstration for creating a bool and using it to control when a limit order should be submitted.
Demo - https://drive.google.com/file/d/1-3P...w?usp=drivesdk
If you have not seen our educational resources on the Strategy Builder, please see below.
Strategy Builder 301 — 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.JimNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jim View PostHello Teebone21,
I have included a demonstration for creating a bool and using it to control when a limit order should be submitted.
Demo - https://drive.google.com/file/d/1-3P...w?usp=drivesdk
If you have not seen our educational resources on the Strategy Builder, please see below.
Strategy Builder 301 — 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.
Comment
-
Hello Teebone21,
The primary data series is the data series we apply the script to. No additional changes would be necessary to have the strategy run on Heiken Ashi bars other than setting the data series to Heiken Ashi when you are setting up the strategy.
Note that with historical backtesting, the OHLC values of the next bar are used to simulate order fills. Heiken Ashi bars create fake values, so this can make backtesting results skewed. Also with the BarsType, the developing values with realtime data are rounded and recirculated in the BarsType's calculation.
When using Heiken Ashi in a strategy, I suggest using an indicator instead of the BarsType.
NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that may be added. The indicator performs in the same manner as the NinjaTrader 7 version. 4-27-18 […]
The 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 add-ons 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.
We look forward to assisting.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, Today, 06:01 PM
|
0 responses
2 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
1 view
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
23 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
||
Started by catinabag, 04-13-2023, 05:46 AM
|
34 responses
1,465 views
0 likes
|
Last Post
by mcosta72
Today, 04:44 PM
|
Comment