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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    45 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X