Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZizZag optimization "not working"

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

    ZizZag optimization "not working"

    Create simple strategy that uses bargo.
    int highAgo = ZZ.HighBar(1, 2, 999); //get previous
    int lowAgo = ZZ.LowBar(1, 2, 999); //get previous
    After starting optimization on different param not related to the ZigZag get message
    Strategy 'xxxx_ZZ_1': Error on calling 'OnBarUpdate' method on bar 2: ZigZag.LowBar: barsAgo out of valid range 0 through -1, was 1
    Use: Calculate = Calculate.OnBarClose;
    What could be the issue?
    -PNF​

    #2
    Hello PageNotFound404,

    Thank you for your post.

    So I may better assist you, please provide a screenshot of your optimization settings. Additionally, do you receive any error messages when trying to run a backtest (not optimization) with similar settings?
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.

    I look forward to your reply.

    Comment


      #3
      Only optimization give me am issue, backtest does not. Backtest Settings:
      Item Value
      Strategy parameters
      NearNbr 3
      dbCnt 2500
      tradeSmaPeriod 20
      Parma1 (i was looking to optimize that and next 3 nothing to do with zigzag @ all) 3.75
      Param2 3.75
      Param3 3.75
      Param4 3.75
      TargetVolatility 35
      StdDevRange 20
      ZZPercent 0.45
      MACDFast 12
      MACDSlow 26
      MACDSmooth 9
      CCIPeriod 14
      Data Series
      Start date 7/1/2010
      End date 2/20/2022
      Price based on Last
      Type Minute
      Value 150
      Tick Replay False
      Trading hours CME US Index Futures ETH
      Break at EOD False
      Setup
      Include commission False
      Label xxxxx_ZZ_1
      Maximum bars look back 256
      Bars required to trade 100
      Historical fill processing
      Order fill resolution Standard (Fastest)
      Fill limit orders on touch False
      Slippage 0
      Order handling
      Entries per direction 1
      Entry handling All entries
      Exit on session close True
      Order properties
      Set order quantity Strategy
      Time in force GTC
      ​Result like this from backtest, not sure how useful that might be??? (or point is it does produce result):
      Performance All trades Long trades Short trades
      Total net profit ($5,706.25) ($8,618.75) $2,912.50
      Gross profit $60,437.50 $28,512.50 $31,925.00
      Gross loss ($66,143.75) ($37,131.25) ($29,012.50)
      Commission $0.00 $0.00 $0.00
      Profit factor 0.91 0.77 1.10
      Max. drawdown ($10,075.00) ($10,781.25) ($2,831.25)
      Sharpe ratio -0.35 -0.47 0.24
      Sortino ratio -0.38 -0.47 0.47
      Ulcer index 0.04 0.04 0.01
      R squared 0.76 0.86 0.66
      Probability 83.21% 97.93% 24.44%
      Start date 7/1/2010
      End date 2/20/2022
      Total # of trades 947 511 436
      Percent profitable 47.41% 46.38% 48.62%
      # of winning trades 449 237 212
      # of losing trades 476 259 217
      # of even trades 22 15 7
      Total slippage 0 0 0
      Avg. trade ($6.03) ($16.87) $6.68
      Avg. winning trade $134.60 $120.31 $150.59
      Avg. losing trade ($138.96) ($143.36) ($133.70)
      Ratio avg. win / avg. loss 0.97 0.84 1.13
      Max. consec. winners 7 7 7
      Max. consec. losers 13 8 13
      Largest winning trade $1,093.75 $637.50 $1,093.75
      Largest losing trade ($1,262.50) ($1,262.50) ($781.25)
      Avg. # of trades per day 2.60 1.42 1.20
      Avg. time in market 142.48 min 144.72 min 139.86 min
      Avg. bars in trade 0.95 0.96 0.93
      Profit per month ($330.25) ($503.59) $168.56
      Max. time to recover 465.20 days 465.20 days 118.86 days
      Longest flat period 5.01 days 9.35 days 9.81 days
      Avg. MAE $143.15 $148.57 $136.80
      Avg. MFE $132.80 $120.28 $147.48
      Avg. ETD $138.83 $137.15 $140.80
      Attached Files

      Comment


        #4
        Hello PageNotFound404,

        Thank you for your reply.

        I would like to continue this via email and review your diagnostic files. Please follow the steps below to manually attach your log and trace files to an email so I may investigate this matter further.
        • Open the Windows File Explorer (hotkey = Windows key + E) Then navigate to, "Documents" > 'NinjaTrader 8' folder
        • Right-click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
        • Send the 2 compressed folders as attachments to an email to support[AT]ninjatrader[DOT]com
          • Please include a link to this forum thread in the body as well as "ATTN Emily 03602273" in the subject and body of the email
        • Once complete, you can delete these compressed folders.
        I appreciate your patience and look forward to resolving this with you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        66 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        141 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        46 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X