PDA

View Full Version : Position entry question


Faspomy
02-18-2010, 10:50 AM
Have a question about entry:


I would like to program a Strategy to buy (EnterLong) everytime one line crosses below another. (SMA(5) cross below SMA(10) for example).


With EntryHandling=AllEntries, the above will process once and hold until the position is closed.

With UniqueEntries, it will basically do the same thing, unless I have different entry logic and a different name.



Is there any way to buy each time X crosses under XX, multiple times if neccessary ?

NinjaTrader_RyanM
02-18-2010, 10:57 AM
Hello Faspomy,

You can define this with EntriesPerDirection.

http://www.ninjatrader-support.com/HelpGuideV6/MaxEntriesPerDirection.html

Faspomy
02-18-2010, 11:43 AM
NT Ryan,

thank you.


As per their example, how would I change this so that it will buy once everytime SMA(10) crossed SMA(20) ?

Doesn't EntriesPerDirection = 5; mean that it will enter 5 positions simultaneously (and not seperately) ?



protected override void Initialize()
{
EntriesPerDirection = 5;
EntryHandling = EntryHandling.AllEntries;
}
protected override void OnBarUpdate()
{
if (CrossAbove(SMA(10), SMA(20), 1)
EnterLong("SMA Cross Entry");

}

NinjaTrader_RyanM
02-18-2010, 11:54 AM
Hello Faspomy,

You would change EntriesPerDirection to the number of entries you want to accept in any one direction. You can set this to 3,5,1001, or any other integer.

Entries per direction is not the same as Order Quantity. If you have it set to 5, it will enter on up to 5 different instances of the rule. If you entered 5 instances of the rule and get another signal, this signal is ignored until one of your positions is closed.

Faspomy
02-18-2010, 12:04 PM
NT Ryan,

thanks !

Faspomy
02-18-2010, 06:12 PM
Another question:

I would like to use AllEntries in a strategy, to buy multiple positions.
Problem: I would like to buy (long) and sell (short) in same strategy.

Can a strategy buy and sell (enter long and short) seperately ?

NinjaTrader_Bertrand
02-19-2010, 04:56 AM
Faspomy, you could do this via market orders, but the overall strategy position size would reflect this of course...if you want this separated please use two individual strategies.

Faspomy
02-19-2010, 07:36 AM
thank you !