Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Automated trading - strategy activated shows a highlight color of yellow
Collapse
X
-
Automated trading - strategy activated shows a highlight color of yellow
After using the strategy wizard and checking it with the strategy analyzer to see all is okay, I activate it for live trading, but it shows a highlight color of yellow instead of green. Can't figure out why and it does not execute when I know the parameters are reached. How to find out the issue?Tags: None
-
Hello CactusMo,
Thank you for writing in and thank you for your patience. A yellow highlighted "Strategy" cell indicates the strategy is waiting until it reaches a flat position before fully starting.
Please see the video below on the different sync options available.
https://www.youtube.com/watch?v=US9c...A140D7&index=7
Please let us know if you have any further questions.Michael M.NinjaTrader Quality Assurance
-
Automated trading - strategy activated shows a highlight color of yellow
Thanks MichaelM,
My positions are flat. I made a few variations of the same strategy and only one of them for some reason will not show green when activated. I will rewrite this particular strategy and call it a different name to see if it just the system that is messing up.
Comment
-
Hello CactusMo,
Please add the following code to the top of your OnBarUpdate() method:
Code:if(Historical) { return; }
To set the DefaultQuantity via code you would use the following:
Code:protected override void Initialize() { //... DefaultQuantity = 5; //... }
Thank you in advance.Michael M.NinjaTrader Quality Assurance
Comment
-
Okay, I understand the problem. Should I execute my strategy now, and as a result of it's calculation it would have executed a position sometime in the not too distant past, it will consider itself not flat and therefore currently in a position. How to make it start fresh from the point of when I actually execute the strategy? Seems pretty stupid for it to think I had executed the strategy and therefore a trade at a time in the past when the strategy was not actually executed live.
Comment
-
Hello CactusMo,
There are two ways you can prevent the behavior you are describing when you are using the strategy wizard with your strategy.
The first way:
-Navigate to Tools -> Options -> Strategies tab -> NinjaScript tab -> Select "Immediately submit live working historical orders"
-Then in the properties of the strategy itself, set "Sync account position" to false.
If you need those options set to other values, you can do this the second way instead:
-Import the attached indicator called "HistoricalData" and add a condition to each of your entries that says "if(HistoricalData()[0] != HistoricalBar)" where HistoricalBar is a User Defined Input set to 1.
Here are all the steps:
1. File -> Utilities -> Import NinjaScript -> HistoricalDataIndicator.zip
2. Tools -> Edit NinjaScript... -> [your strategy]
3. Next -> Next -> create "HistoricalBar" as an "int" with a Default and Min of 1.
4a. Next -> For each "Set" (Set 1, Set 2, etc) that you enter/exit a position, you need to "Add" an additional condition
4b. In the Condition Builder on the left side (the popup you get when you press "Add"), expand the indicators dropdown and select HistoricalData
4c. Set the operator to "!=" in the middle.
4d. Expand the User defined inputs on the right side and select "HistoricalBar" -> Press OK
Unfortunately there is no way without unlocking your code (and not being able to use the strategy wizard to edit it anymore) to modify the default DefaultQuantity variable. When using a strategy created with the strategy wizard, the only way to do this is to set the DefaultQuantity value to 5 manually in the strategy properties window before running it.
I have included a picture of where these properties are for your convenience.
Please let me know if you have any further questions.Michael M.NinjaTrader Quality Assurance
Comment
-
Thanks Michael M. It works perfectly. I can now execute my strategy without it turning yellow even if the parameters would have had it executed within the past few hours. I used your 2nd option to incorporate historical data within my strategy wizard. I now change the default of 1 contract to 5 by setting "Default quantity" each time I initiate my strategy.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, Yesterday, 08:57 AM
|
11 responses
28 views
0 likes
|
Last Post Today, 09:06 AM | ||
Started by yertle, Today, 08:38 AM
|
1 response
5 views
0 likes
|
Last Post Today, 09:02 AM | ||
Started by love2code2trade, Yesterday, 01:45 PM
|
3 responses
22 views
0 likes
|
Last Post Today, 09:00 AM | ||
Started by trilliantrader, Today, 08:16 AM
|
2 responses
6 views
0 likes
|
Last Post Today, 08:51 AM | ||
Started by samish18, Today, 08:31 AM
|
1 response
2 views
0 likes
|
Last Post Today, 08:49 AM |
Comment