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
Miscelleneous Questions
Collapse
X
-
Miscelleneous Questions
How do I determine whether OnBarUpdate() is called for a bar that has just completed (or just started forming) versus just a tick update?
I am entering into a long position in my script and then adding a stop loss and target profit to it. I can do that fine. Next, when either the SL or target profit gets reached, I want to trigger another action such as enter a new Long order. How would I do this?
If I have different Ninja strategies running in the same chart or different charts, how can I have the strategies communicate with each other? In esignal, there is a way to set up global var's that all strategies have access to. Is there a similar thing in Ninjascript? I am also a newbie at c# so I am not aware yet how to use variables across namespaces.
Can ninjascripts call external DLLs that I write? Again, I've done this in esignal but struggling to find this capability in ninjascript. Can you point me to the docs if they exist telling me the interface description, etc.RayNinjaTrader Customer ServiceTags: None
-
One thing that I have not seen clarified about the MarketPosition.Flat function is that does it work for the account that the strategy is running on, or does that apply to all the active accounts you have in Ninja Trader?
In my testing, I have been making the assumption that it is for the particular account that the strategy is running on.
For example, if I had a Sim101 and a Sim102 and the strategy is running on Sim101, it only checks on Sim101 and not for both Sim101 and Sim102.
-
Ok, so does the MarketPosition.Flat work based on both the account and strategy?
So if I have 2 strategies running on the same account (say StrategyA and StrategyB), StrategyA will only check for positions initiated by itself so even if there are open positions created by StrategyB, it will still say that the positions are flat for StrategyA.
Sorry if this is getting too confusing, but apparently the strategy was still firing off orders left and right even though I'm checking for open positions. Also, does MarketPosition.Flat work if the orders were initiated by an ATM strategy?
Comment
-
So if I have 2 strategies running on the same account (say StrategyA and StrategyB), StrategyA will only check for positions initiated by itself so even if there are open positions created by StrategyB, it will still say that the positions are flat for StrategyA.
Also, does MarketPosition.Flat work if the orders were initiated by an ATM strategy?
RayNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
27 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
193 views
0 likes
|
Last Post
by Hasadafa
Yesterday, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,235 views
0 likes
|
Last Post Yesterday, 08:07 PM |
Comment