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
How to scale in to position?
Collapse
X
-
How to scale in to position?
Please show me how to use the wizard to simply add to a long position if my current unrealized pnl is in the red. So if MACD crossed above 0 I go long and if my current position is negative then wait for MACD to cross above 0 again and add to this position. Basically I want to average lower my current position price. Thank youTags: None
-
relogical,
Ok, so you can check PnL in your condition builder and compare to numeric value. The issue here is that the strategy wizard uses the "managed approach" so what can happen is it won't let you open another position with the same signal name, or even another position with a different signal name depending on your entry handling.
Here is more information on entry handling, I would suggest you read and try to understand because it can change how you implement this : http://www.ninjatrader.com/support/f...37&postcount=2
Please see the screen shot for info on how to setup one and only one additional order via unique entry signal. In this case we would want EntriesPerDirection = 1, and Entry Handling set to "UniqueEntries".Last edited by NinjaTrader_AdamP; 07-08-2012, 11:48 AM.Adam P.NinjaTrader Customer Service
Comment
-
IT's not working for me. Please help me to resolve this. My code is below:
Code:/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Condition set 1 if (Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) < -30) { Variable0 = 0; } // Condition set 2 if (Open[0] > Open[1]) { EnterLong(PositionSize1, ""); Variable0 = 1; } // Condition set 3 if (Variable0 == 1 && Variable0 == 0) { EnterLong(PositionSize2, ""); Variable0 = 2; } // Condition set 4 if (Variable0 == 2 && Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) > 2) { ExitLong("", ""); } // Condition set 5 if (Variable0 == 1 && Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) > 2) { ExitLong("", "");
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by marcus2300, Yesterday, 10:21 AM
|
6 responses
20 views
0 likes
|
Last Post
by marcus2300
Today, 01:53 AM
|
||
Started by skorpn, Today, 01:28 AM
|
0 responses
8 views
0 likes
|
Last Post
by skorpn
Today, 01:28 AM
|
||
Started by ETFVoyageur, Today, 12:52 AM
|
0 responses
6 views
0 likes
|
Last Post
by ETFVoyageur
Today, 12:52 AM
|
||
Started by Board game geek, Yesterday, 02:20 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 12:30 AM | ||
Started by jackiegils, Yesterday, 11:05 PM
|
0 responses
7 views
0 likes
|
Last Post
by jackiegils
Yesterday, 11:05 PM
|
Comment