Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

difference in perfomance between 1 day and 1 min

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

    difference in perfomance between 1 day and 1 min

    hi,

    I backtested strategy and noted that the same logic and conditions wriiten in 1 day ( conditions for 1 day) and 1 min (conditions for 1day) are absolutly different. To whom to believe?

    conditions 1 day :
    if (Low[0] < Low[1]
    && Open[0]>Close[0]
    &&( ATR_percentage(100,14)[0] >= Bollinger( ATR_percentage(100,14),2,30).Upper[0] )
    && NDX(260)[0]<60 )
    {
    EnterShortStopMarket(100,Low[0] - 0.05,name);
    SetStopLoss(CalculationMode.Percent,0.0025);
    SetProfitTarget(CalculationMode.Percent,0.01); }

    conditions for 1 min:


    AddDataSeries( Data.BarsPeriodType.Day,1);



    if (Lows[1][1] < Lows[1][2]
    && Opens[1][1]>Closes[1][2]
    && NDX(BarsArray[1],260)[1]<60
    &&( ATR_percentage(BarsArray[1],100,14)[1] >= Bollinger( ATR_percentage(BarsArray[1],100,14),2,30).Upper[1] )
    && alreadyTradedToday == false
    )
    {
    alreadyTradedToday = true;

    EnterShortStopMarket(sharesToBuyatr,PriorDayOHLC() .Low[0] - 0.05,name);
    SetStopLoss(CalculationMode.Percent,0.0025);
    SetProfitTarget(CalculationMode.Percent,0.01); }

    }

    in 1 min there´s just 1 trade per day permitted.
    Also i changed indexing -1 day in 1 min conditins .

    so run these 2 strategies in 1 day and 1 min and there are different number of entries , in different days… where is the problema? How can i fox it? and which perfomance shpuld i believe?

    #2
    Hello margandi,

    Thanks for your post.

    You will want to make sure that the logic is being processed on the same data series. If the additional data series is added, we will want to use a BarsInProgress check to ensure the logic is being processed on that data series if we want to have similar results. Having the logic processed on a minute series and a daily series will have different results.

    I have attached an example that can demonstrate how close you can get the backtest when having logic and orders submitted on a secondary data series. This strategy can be compared against the Sample MA Crossover strategy on a daily series. Please note that the final Exit On Session Close behaviors will be different since the primary data series is used to fill the order. We can note in the screenshots attached that the final Exit On Session Close trade has the same entry price for the trade but different exit prices.

    We look forward to being of further assistance.
    Attached Files
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    6 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    9 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    20 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X