PDA

View Full Version : Entry / Exit Strategy


Edgar V.
03-05-2008, 03:26 AM
I created 2 sets using the Strategy Wizard. Set 1 is suppose to enter the market and Set 2 is suppose to exit the market. The problem is that it is working discretionary, which means that while testing it, it enters the market in Set 2, instead of Set 1, eventhough I made sure it says "Enter Long" in Set 1 within "do the following" in the wizard.

NinjaTrader_Dierk
03-05-2008, 06:28 AM
Your understanding is correct. Here is how it works:

- if Set1 is true do something
- if Set2 is true, no matter if Set1 is true or no, do something else

-> Set1 and Set2 are just different and independent conditions

Edgar V.
03-05-2008, 07:07 AM
Question: How can I create a condition using the wizard that meets the following:

- If Set 1 is true do something
- Set 2 won't execute until Set 1 is true
Maybe this is not built in different Sets maybe is within the same Set, I'm not sure.

Please advice.

NinjaTrader_Dierk
03-05-2008, 07:15 AM
Unfortunately this is not doable within the wizard. Of course you could code it in NinjaScript.

Edgar V.
03-05-2008, 07:18 AM
Can you send me a sample code that do this?

NinjaTrader_Dierk
03-05-2008, 07:22 AM
Actually you could try this in wizard:
- enter your Set1 conditions and add your Set1 actions
- switch to Set2 and reenter the same condition you had on Set1 and your additional Set2 conditions and add your Set2 actions.

This should do the trick

Edgar V.
03-05-2008, 08:36 AM
My concern is that in Set 1 I'm very specific in terms of "Bar0 > Bar1..." and I'm not sure if this would work. Will it work anyway?

NinjaTrader_Dierk
03-05-2008, 08:37 AM
Any condition which works for Set1 will work for Set2

Edgar V.
03-05-2008, 09:03 AM
The series of conditions entered in a specific set, example Set 1, are they treated as "AND" or as "OR"?

NinjaTrader_Dierk
03-05-2008, 09:05 AM
>> are they treated as "AND"
Correct

Edgar V.
03-05-2008, 09:20 AM
I use a specific set of conditions such as Bar1 > Bar2 among others to enter a position (Let say for example Set 1 to "Enter Long"). My concern is that if I do what you suggest in Post #6, to re-enter the same conditions in Set 2 (Remember that I'm specific in terms of how many bars ago to execute an "Enter Long") and if I include the condition to Exit the Long position, then I'm afraid that the Exit won't execute, because is reading a series of conditions that are not related to what I want to Exit the position already in because the exit is not based on the amount of Bars I specify in Set 1.

NinjaTrader_Dierk
03-05-2008, 09:25 AM
OK, then I'm am a loss on what you want to achieve. You said below that Set2 only should be triggered as conditions of Set1 are true. Now you're saying, that's not the case ?!?

Can you please EXACTLY explain what you want to achieve?

Edgar V.
03-05-2008, 09:34 AM
Yes is the case, don't get me wrong. I'll execute the Strategy tonight with the new recommendation you gave me and I'll let you know how it goes. Thanks.

DivineDragon
03-08-2008, 11:43 AM
You can also set a variable in Set 1 and check the value of the variable in Set 2.

That way you don't have to maintain the same set of conidtions in Set 1 and Set 2 as you tweak them

Edgar V.
03-10-2008, 05:53 AM
I have another question:

Let say I'm using the SMA indicator with a 1 day chart to get in with a market order. What I've seen so far is that the order gets in position and executed at the closing of the bar that crosses above / below the SMA. What I'll like to see is to get in the market order as soon as the bar touches the SMA, not at the closing of the bar.

How can I do this using the Strategy Wizard?

Edgar V.
03-10-2008, 08:16 AM
I think I just found the answer. Instead of a market order, I have to place a limit order. This way I assure the order placement in the right moment, instead of leaving it to the closing of the Bar.

Edgar V.
03-17-2008, 07:23 AM
Question: By using the Wizard, Is there a way I can enter / exit a position for a 1 day chart, but at the close of the Bar of an 1 hour chart?, so I don't have to wait to the 1 day closing bar to execute the order?

Example:
Chart Time = 1 day

If Bar0 CrossAbove SMA,
then buy # lots (Here I'll like to have the hourly chart as a reference to place the order)

Thanks.

NinjaTrader_Dierk
03-17-2008, 07:26 AM
Unfortunately the wizard does not support multi-series strategies. You would need to custom code using NinjaScript.

Edgar V.
03-17-2008, 07:27 AM
Any references on how I can custom code something like this?

NinjaTrader_Dierk
03-17-2008, 07:29 AM
No particular one. I suggest looking here: http://www.ninjatrader-support.com/vb/forumdisplay.php?f=30
... and checking the tutorials on the help guide.