Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to get SetTrailStop working in backtest

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

    Unable to get SetTrailStop working in backtest

    Hi,
    I've been trying to backtest SetTrailStop(), but I have not been able to get it to work. I am using TD ameritrade backtest data (minute only). Any tips?


    Here's the basic test code:

    protected override void Initialize()
    {

    SetTrailStop("EnterLong",CalculationMode.Percent,S top,true);
    CalculateOnBarClose = true;

    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    if (CCI(14)[0] > MainEntryCriteria && Rising(this.TEMA(20)))
    {
    EnterLong(DefaultQuantity, "EnterLong");
    }

    }

    #2
    Please debug your strategy as per here:

    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