Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2 ticks offset strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    2 ticks offset strategy

    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. [email protected]

    #2
    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/pa..._education.htm

    Also: the community might want to contribute ?!?

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, Yesterday, 01:02 PM
    0 responses
    30 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    22 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X