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
Only one enter long order is triggered when all conditions are met
Collapse
X
-
Hello Gav_G,
I would expect defaults to take effect immediately in the Strategy Analyzer without having to close it.
I've tested on my end to confirm. Are you able to reproduce this behavior with the Strategy Analyzer?
Leave a comment:
-
Hi Chelsea
Thanks for this, I now have this working, I think it was due to me needing to re add it to the chart.
I was using the strategy analyser which I had open, I was compiling in the strategy builder & then hitting run. Am I right in saying that for default settings to take effect, I would need to close & reopen the strategy analyser?
Leave a comment:
-
Hello Gav_G,
Unique entries would allow for both entries when each entry has a unique signal name.
Have these default settings been changed and the script compiled since the script was added to a chart? (If so, remove and re-add the instance from the chart to reload the defaults)
If that does not correct the behavior, may I test the script on my end?
To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:- Click Tools -> Export -> NinjaScript...
- Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
- Click the 'Export' button
- Enter a unique name for the file in the value for 'File name:'
- Choose a save location -> click Save
- Click OK to clear the export location message
- (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
http://ninjatrader.com/support/helpG...-us/export.htm
Once exported, please attach the file as an attachment to your reply.
Leave a comment:
-
Hi Emma, thanks for the response, I've tried this but it's not working
If I'm using multiple entries I'm assuming I should use unique entries though?
Leave a comment:
-
Only one enter long order is triggered when all conditions are met
Hi
I have created a strategy to test using the strategy builder wizard. I've used the wizard to get the framework of the system sorted, & am expecting to update the code for some of the more details conditions.
When my conditions are met I want to create 2 buy market orders. I've created them both in the wizard but only one is being triggered, the first one in the list.
I've tried to set the unique entries or all entries, I've also changed from number of entries per direction to 2. Something isn't working correctly here but I'm not sure why.
The reason I want to use 2 orders is so that I can have one set to a fixed profit target & one will use a trailing stop that I'm going to have to code myself I think.
Any help would be appreciated, please see the code below
Code:EntriesPerDirection = 1; EntryHandling = EntryHandling.UniqueEntries;
Code:protected override void OnBarUpdate() { if (BarsInProgress != 0) return; if (CurrentBars[0] < 1) return; // Set 1 if ((RSI1.Avg[0] > RSI_long)) { EnterLong(Convert.ToInt32(DefaultQuantity), @"Buy_2"); EnterLong(Convert.ToInt32(DefaultQuantity), @"Buy_1"); } // Set 2 if (Close[0] < HMA1[0]) { ExitLong(Convert.ToInt32(DefaultQuantity), @"Exit_Long_1", @"Buy_1"); ExitLong(Convert.ToInt32(DefaultQuantity), @"Exit_Long_2", @"Buy_2"); } }
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by carnitron, 03-25-2024, 01:59 PM
|
11 responses
50 views
0 likes
|
Last Post
by carnitron
Today, 02:18 PM
|
||
Started by Gerik, 12-21-2023, 08:20 AM
|
15 responses
202 views
0 likes
|
Last Post
by Mindset
Today, 02:06 PM
|
||
Started by visvabalaji, Today, 02:04 PM
|
0 responses
3 views
0 likes
|
Last Post
by visvabalaji
Today, 02:04 PM
|
||
Started by spottysallrite, Today, 11:31 AM
|
6 responses
14 views
0 likes
|
Last Post Today, 01:53 PM | ||
Started by volIQ, Yesterday, 04:28 PM
|
2 responses
16 views
0 likes
|
Last Post
by volIQ
Today, 01:42 PM
|
Leave a comment: