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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X