I left out the 6th pic, too many. But it's StopPrice <= GetCurrentAsk(Default Input) vs StopPrice >= GetCurrentBid(Default Input)
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
Left is the short strategy and right-side long strategy, long side working perfect.
Collapse
X
-
Left is the short strategy and right-side long strategy, long side working perfect.
For the short side strategy, on the left, I'm doing something incorrectly. By looking at these screenshots where could I be going wrong?
I left out the 6th pic, too many. But it's StopPrice <= GetCurrentAsk(Default Input) vs StopPrice >= GetCurrentBid(Default Input)Tags: None
-
Hello trdninstyle,
Thank you for your note.
What is the behavior your strategy is displaying vs. what you expect? One thing I notice has to do with the price for StopPrice and TriggerPrice; these may need to be adjusted as Position.AveragePrice plus or minus a value based on whether you are long or short. Profit and loss are in different directions depending on whether you are long or short. It looks like in both screenshots you are adding (+) to calculate the StopPrice and TriggerPrice but you may need to subtract (-) in some scenarios.
Please let me know if I may be of further assistance.Emily C.NinjaTrader Customer Service
-
-
-
Hello trdninstyle,
Thank you for your reply.
I apologize for any confusion; it appears that your inputs are either negative or positive depending on whether it is the long or short strategy. I still do not understand the difference between how your strategy is behaving vs. how you are expecting it to behave. The lines in your screenshots don't demonstrate to me what part of the strategy "ends up not calculating" - please provide a more in-depth description of what you want your strategy to do and what part of it is not taking the desired action so I may better understand and assist you. What is the difference between how the long strategy is performing vs. the short strategy?
I look forward to your reply.Emily C.NinjaTrader Customer Service
Comment
-
Well, I'm expecting the short side to behave like long side but of course the opposite. The long side is the one thats working, except for a minor hiccup, I guess.
I think in set 1 it's supposed to be the same as the long setup in set 1. Being TriggerState >= 2 but I have it <= the opposite.
Later on, when I have the short working properly & I make it as one strategy, up and down, don't I leave set 1 for both of them? And the set 5, leave the same? That is when they are both together as one strategy.
If I do, then thats the first mistake I made, this, <= and >=
The short side strategy is supposed to take profit at -6 ticks, the breakeven -1 triggered at -5 ticks, Initial stop loss at 4 ticks.
As I scroll back before the long black line where it appears to work, (but it doesn't) the profits are for 1 tick or in & out at the same spot.
It will come, it's the journey that I enjoy, when it's all figured out what do I do then? lol
The breakeven -1 is not in the inputs though, the -1. But the trigger is in the input set at -5 to trigger the b.e. at -1.
The limit order short 1 is the input, so I can toggle that feature back & forth for testing. (it's +1 not -1, I type it wrong here)Last edited by trdninstyle; 11-23-2022, 02:02 PM.
Comment
-
-
Hello trdninstyle,
Thank you for your patience.
I recommend adding Print() statements to understand the variables and values being used (such as StopPrice and TriggerPrice) inside of your conditions. We have more detailed information about using prints as a debugging tool, including a video about how to add prints in the Strategy Builder, at the following links:
This can help you to see how the different values are evaluated throughout the life of the script and better understand what is causing different strategy behaviors. I am glad to hear that this is a journey you enjoy! We are always glad to answer questions about NinjaScript development and provide resources from our help guide as well as simple examples. We also assist with guidance through the debugging process in order to understand unexpected behavior.
Please let me know if I may be of further assistance.Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by llanqui, Today, 03:53 AM
|
0 responses
2 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
14 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
||
Started by strategist007, Yesterday, 07:51 PM
|
0 responses
14 views
0 likes
|
Last Post Yesterday, 07:51 PM |
Comment