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

ZigZag barsAgo

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

  • NinjaTrader_JoshG
    replied
    M,

    Your screenshot shows a chart with a NinjaScript Output window displaying what is supposedly your codes output. We would need to see some code along with that output to know why you are getting these specific results

    Leave a comment:


  • mntemel
    replied
    Hi Josh, I attached the strategy in my initial post, you can see the print code which is in it.

    Thanks
    M

    Leave a comment:


  • NinjaTrader_JoshG
    replied
    Hello mntemel,
    Thanks for your post.

    We would need to see the code for your Print() to know what was happening specifically

    Leave a comment:


  • mntemel
    started a topic ZigZag barsAgo

    ZigZag barsAgo

    Hi I've been trying to define previous highs and lows by using ZigZag's inbuilt barsAgo function but haven't been able to succeed. Here is the link for the definition in case anyone's interested



    Attached is a simple strategy that plots the ZigZag indicator and prints with bars ago numbers for the previous highs and lows. My understanding is on each bar you can tell "how many bars ago you had the previous high, or the one before that, etc..) I'm applying this to a CL 07-19 contract 200 volume chart in case you want to replicate the case.

    In the attached image, you'll see I marked the Bar at 18:51:59. According to the Print, while at that bar, the previous high was 7 bars ago which seems correct, but the print says the high before that was 12 bars ago which seems incorrect.

    Could you please tell me where i'm going wrong here?

    Thanks
    M
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by algospoke, 04-17-2024, 06:40 PM
6 responses
49 views
0 likes
Last Post algospoke  
Started by arvidvanstaey, Today, 02:19 PM
4 responses
11 views
0 likes
Last Post arvidvanstaey  
Started by samish18, 04-17-2024, 08:57 AM
16 responses
61 views
0 likes
Last Post samish18  
Started by jordanq2, Today, 03:10 PM
2 responses
11 views
0 likes
Last Post jordanq2  
Started by traderqz, Today, 12:06 AM
10 responses
21 views
0 likes
Last Post traderqz  
Working...
X