• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Lisa Marshall, 01-25-2020, 04:11 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by utilizator, 01-25-2020, 11:36 AM
    2 responses
    32 views
    0 likes
    Last Post utilizator  
    Started by Aporshnev, Today, 08:46 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Tyler  
    Started by fx.practic, Today, 08:54 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by fx.practic, Today, 08:50 AM
    2 responses
    4 views
    0 likes
    Last Post fx.practic  
    Working...
    X