Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Limiting consecutive same direction trades
Collapse
X
-
Limiting consecutive same direction trades
Is there a way in the Ninja Strat Wizard to limit the number of consecutive trades either long or short? I would like to limit the strat to take for example 3 long trades or 3 short trades in a row and then reverse to the opposite direction. Thanks in advance.Tags: None
-
Hello futures614,
Thank you for your note.
This would not be possible with the Strategy Wizard.
To find the number of consecutive orders in a direction you will need to use a loop:
(edit)
Code:consecutiveOrders = 0; for (int i=Performance.AllTrades.Count; i>0; i--) { //Print(i+" - "+Performance.AllTrades[i-1].ToString()); if (Performance.AllTrades[i-1].Entry.MarketPosition == Performance.AllTrades[[B]Performance.AllTrades.Count-1[/B]].Entry.MarketPosition) { consecutiveOrders++; } else { break; } } Print(consecutiveOrders);
You could also choose to increment a value in OnOrderUpdate or OnExecution that resets when an order is in the opposite direction.Last edited by NinjaTrader_ChelseaB; 08-04-2014, 03:39 PM.Chelsea B.NinjaTrader Customer Service
-
-
Conditions & actions ? for the strategy wizard
I'm trying to use the slope or rising/falling of a trend indicator in my conditions and actions for filtering longs and shorts. I would appreciate any help as how that can be done in the strat wizard. Thanks in advance.
Comment
-
-
I followed the screenshot example and I receive the following error message:
Return type of left expression 'Boolean' and right expression 'ADL' do not match. I get the same error when I try to use the StepMa indicator that I'm trying to incorporate into my strat.
I would appreciate any help you can offer. thanks youLast edited by futures614; 08-05-2014, 10:04 PM.
Comment
-
The name of the old indicator(StepMaV72Sharky) in the strat wizard is not the same name as the indicator under tools/edit ninjascript/indicator(StepMa). I thought the old indicator showing in the strat would be replaced when I downloaded a newer version. I deleted all the files of the old indicator I could find, restarted Ninja and still find the V72 in the strat wizard. How do I get the newer version to show in the strat wizard? The new version shows in my list when I do a chart.Last edited by futures614; 08-05-2014, 10:03 PM.
Comment
-
Hi futures614,
May I have a screenshot of the Strategy Analyzer with the Rising condition you are making?
To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
For detailed instructions please visit the following link
http://take-a-screenshot.org/
Regarding the StepMaV72Sharky indicator, the way it shows in the Strategy Wizard should be the same as the Indicators list from a chart (but may be different from the list of indicators in Tools -> Edit NinjaScript -> Indicator...)
Have you closed the Strategy Wizard and reopened it to see if the list has updated?
May I have a screenshot of how this appears in the Indicators window from a chart?
May I have a screenshot of how this appears in the Strategy Wizard?
I look forward to your reply.Chelsea B.NinjaTrader Customer Service
Comment
-
Requested screenshot of strat wizard
Originally posted by NinjaTrader_ChelseaB View PostHi futures614,
May I have a screenshot of the Strategy Analyzer with the Rising condition you are making?
To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
For detailed instructions please visit the following link
http://take-a-screenshot.org/
Regarding the StepMaV72Sharky indicator, the way it shows in the Strategy Wizard should be the same as the Indicators list from a chart (but may be different from the list of indicators in Tools -> Edit NinjaScript -> Indicator...)
Have you closed the Strategy Wizard and reopened it to see if the list has updated?
May I have a screenshot of how this appears in the Indicators window from a chart?
May I have a screenshot of how this appears in the Strategy Wizard?
I look forward to your reply.
Comment
-
Comment
-
Comment
-
Hi futures614,
Thank you for the screenshots.
Just to confirm, you have recompiled and restarted NinjaTrader before taking these screenshots correct?
If so, I'd like to take a look at this with you. Please send an email to platformsupport [at] ninjatrader [dot] com. In the email, please add a link to this forum thread.Chelsea B.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
4 responses
23 views
0 likes
|
Last Post Today, 08:19 AM | ||
Started by Brevo, Today, 01:45 AM
|
1 response
14 views
0 likes
|
Last Post Today, 08:14 AM | ||
Started by rjbtrade1, 11-30-2023, 04:38 PM
|
2 responses
73 views
0 likes
|
Last Post
by DavidHP
Today, 08:12 AM
|
||
Started by suroot, 04-10-2017, 02:18 AM
|
5 responses
3,021 views
0 likes
|
Last Post Today, 08:11 AM | ||
Started by Stanfillirenfro, Today, 07:23 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:37 AM |
Comment