PDA

View Full Version : 2 ticks offset strategy


alex12lad
07-22-2007, 07:27 PM
Hi,
I don't know C++ and need some help in implementing one strategy.
I want to enter long 2 ticks below the ask generated by one of the Kwikpop indicators. This indicator = 1, only for the signal bar when it was generated.
Of course, 2 ticks below the ask could be generated on the current bar, or on the next one, or the following one or never.
So, it looks like I have to save the ask on the signal bar and then subtract 0.5. I'm not sure I'm doing it correctly.
That's the excerpt:
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
double x;

///condition set 1 (trying to get the current
///ask and save it but how?!)
if (N [0] == 1)

{

x = GetCurrentAsk();
}
/// Condition set 2
/// if the condition of 2 ticks below comes, let's say, only on the second
/// bar after signal, then N[0] wouldn't be equal 1, but
///on the previous bar N[1] was equal 1.

if (N[0] == 1
||
N[1] == 1

||
N[2] == 1)


{
EnterLongLimit(2,double.x-0.5);
}
Unfortuanately, there are compilations errors.
I'd appreciate your reply.
Alex. alex12Lad@yahoo.com

NinjaTrader_Dierk
07-22-2007, 11:30 PM
Sorry, due to bandwidth reasons we are unable to support down to the level of actual coding or reviewing strategies. You might consider contacting a NinjaScript consultant: http://www.ninjatrader.com/webnew/partners_onlinetrading_education.htm

Also: the community might want to contribute ?!?