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

Max/Min of last 26 Bars

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

    Max/Min of last 26 Bars

    Hi im trying to create an indicator that displays me the highest or lowest value of the last 26 items.
    i tried it that way:

    But it always looks like that:
    Click image for larger version  Name:	Oszi.jpg Views:	1 Size:	125.6 KB ID:	1070725

    i dont know why it always jumps back to 0 instead od showing a proper line.

    Can you please help me? I spent about 6 hours trying to get it to work but im not able to^^
    Last edited by Branpo; 09-15-2019, 03:05 PM.

    #2
    Hi Branpo, thanks for your post.

    It looks like this is happening because your picking to fill values for Values[5] or Values[6] and not setting a value for each of them on every bar. Also, try zooming into the data on the y axis. Is the value actually 0 or is it some number close to 0? You can also Print out whatever cotDataList[i] is on every bar to see why its getting plotted this way. e.g. Print(cotDataList[i].Max); and Print(otDataList[i].Min);

    I look forward to hearing of your results.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi ChrisL,
      thank you for your fast reply!
      Attached Files
      Last edited by Branpo; 09-15-2019, 03:05 PM.

      Comment


        #4
        Hello Branpo, thanks for your reply.

        It seems to be a problem with the LINQ statement, but LINQ assistance is beyond the scope of support I can provide. From what I can see, it looks like using Min and Max are giving you one value for a whole week and that value is the same for each bar, causing the zig-zagging line, or something along those lines. I would be happy to run your code on my end. Just send the required materials to platformsupport at ninjatrader.com and reference "ATTN ChrisL 2275050". See here for instructions on Exporting.

        Best regards.

        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        10 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        56 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        8 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        47 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X