Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitLongStop acting strangely in backtesting

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

    ExitLongStop acting strangely in backtesting

    Hi,

    I am not sure why this happened once in a backtest. Enclosed is a screenshot. In almost all backtested trades, the ExitLongStop acted the way it was supposed to and got out at 2 points below the entryprice. However, there is one instance in the backtest where it exits at 11.25 points below the entryprice making my partner very uncomfortable in going live with this system. Below is some example code where I utilize this exit with the entry logic stripped (I just say if (x)). I am not sure why this happened once in the backtest and assume there is something I did incorrectly with the ExitLongStop and it is suttle as I looked over the help examples and the function signature and can't seem to find what I did wrong. Any help is appreciated. Here is my sample code:


    Thank you,
    David




    DStop=2.00;


    if(x)
    {
    EnterLong("By");
    }

    if(Position.MarketPosition == MarketPosition.Long)
    {

    double DStop = Position.AvgPrice-stop;


    ExitLongStop(DStop,"By");

    }
    Attached Files

    #2
    Hello Cowpux,

    Thank you for your post.

    You would want to use TickSize and multiply this for the appropriate point size. For the ES there is 4 ticks to the point, so you could do the following:
    Code:
    double DStop = Position.AvgPrice - ((stop*4)*TickSize);
    For information on TickSize please visit the following link: http://www.ninjatrader.com/support/h...7/ticksize.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 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
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X