PDA

View Full Version : Need to have one strategy start another strategy


crazytiger
06-19-2007, 03:52 AM
HI,
I need to do something like the following:
When my strategy A starts, it immediately enters a LONG position.
Once the LONG position is entered, the price is retrieved for the LONG position and then this strategy A loads strategy B which gets passed the fill price of the LONG position.
Strategy B then opens a SHORT position based upon the price of the LONG position. It may then load stratgy C, passing the filled price of the SHORT position.

Can someone tell me, how do I pass the entry prices between strategies,
how do I kick-off a strategy from within another strategy, and if it is possible to close a strategy form within another strategy?

Sorry for dumb questions. I am a newbie!

NinjaTrader_Dierk
06-19-2007, 04:09 AM
>> how do I kick-off a strategy from within another strategy, and if it is possible to close a strategy form within another strategy?
Not possible. However, you could try to code your logic in one strategy instead of two.

Note:
- a strategy may have multiple entries/exits over time. A strategy is not (!) terminated after the first trade is closed.
- you may even "tag" entries and have multiple entries active the same time. Please check out the tutorials: http://www.ninjatrader-support.com/HelpGuideV6/Overview39.html

crazytiger
06-19-2007, 04:15 AM
The problem I am trying to solve is that I want to have long and short positions in the same instrument simultaneously. The only way to do this is to have separate strategies for each request so that one does not cancel the other.

But, I absolutely need this event-driven, so that the second strategy only submits it's order once the first one is filled.

I jsut figured out how to do this. I will have to use static var's that all strategies can access. I will start up all strategies at the beginning.
then when strategy A gets it's order filled, it sets a flag that stratgy B can poll for. At this point, strategy B can submit it
s order.

Does this sound like the only way I can do this??

NinjaTrader_Dierk
06-19-2007, 04:18 AM
I see.

>> I will have to use static var's that all strategies can access
Yes, you could try that.