Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Automated Strategy?
Collapse
X
-
Hello kinkeadfx,
To have a breakeven movement you will need to use exit orders instead of SetStopLoss() or SetTrailStop().
Then you will need to use custom logic to control when the order is moved.
Attached is an example I have created for other clients. This is just to give you an idea of how to make this kind of logic for the Strategy Wizard. (I also have custom code made in unlocked strategies if you would like this as well)Attached FilesChelsea B.NinjaTrader Customer Service
-
Hi kinkeadfx,
Attached is the unlocked code.
This demonstrates using OnBarUpdate and OnMarketData to move a stop loss (which can be done in an unlocked strategy).
You don't have to use OnBarUpdate or OnMarketData, this gives a general idea of how to manipulate the stop loss.Attached FilesChelsea B.NinjaTrader Customer Service
Comment
-
Hi kinkeadfx,
Yes, you can add multiple strategies and indicators to a chart.
The strategies and indicators will work independently, but if they are working on the same account and same instrument, they will both be submitting orders that will affect the account position while keeping their own independent strategy position.
I would not recommend running two strategies on the same instrument on the same account. They will not be able to see orders that are made from outside of that strategy instance.
Below is a link that describes the strategy position and the account position.
https://www.youtube.com/watch?v=US9c...A14C398CA140D7Chelsea B.NinjaTrader Customer Service
Comment
-
Hi kinkeadfx,
I would look to understand how this is working and then try and use the same kind of logic on your script.
Here is the low down on how this works:
Condition set 1 checks that the position is flat
If true:
Variable0 is set to the trigger price
Variable1 is the to initial stop price
Variable2 is set to correct the trigger price one bar after entry
Variable3 is set to 0 to reset the trigger so that the breakeven only happens once
Condition set 2 checks that the position is long and Variable2 is 0.
If true:
Variable0 is corrected to the entry price plus the trigger amount
Condition set 3 checks that the position is long, that the close price has met the trigger price, and that Variable2 is set to 0 and ready to trigger.
Once these are true:
Variable1 is set to the Position.AvgPrice which is the entry point
Variable3 is set to 1 so the breakeven is not triggered again
DrawDiamond is called to mark the chart where the breakeven was triggered
Condition set 4 checks that we are in a long position
If true:
ExitLongStop is called to set the stop to the current value of Variable1 which is set in condition set 1 and then condition set 2Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by carnitron, Today, 08:42 PM
|
0 responses
2 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
3 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,969 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
5 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
58 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
Comment