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

how does this instruction work?

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

    how does this instruction work?

    Click image for larger version

Name:	Capture.JPG
Views:	154
Size:	73.3 KB
ID:	1199811 Hello
    i already posted a question about this indicator but I found again something that I did not understand

    In this indicator Autotrendlinecreated by you or your colleague NinjaTrader_Paul
    https://ninjatraderecosystem.com/use...totrendline-2/
    Direct link https://ninjatraderecosystem.com/use...425d1651141555

    can you explain me how this instruction 128 or 176 works
    there is a loop
    for (int barsAgo = upTrendEndBarsAgo - 1; barsAgo >= 0; barsAgo--)
    {
    if (Close[barsAgo] < endBarPrice + (Math.Abs(upTrendEndBarsAgo - barsAgo) * changePerBar))

    barsAgo starts when there is a signal
    upTrendEndBarsAgo last bar that touches the trend

    in barAgo is desincremented
    and each time have tested Close[barAgo ]
    sometimes barAgo exceeds 30
    so how do we test Close[30]? (example)
    whereas normally we test the last bar that will close or cross the trend

    Thank you for your patient
    Last edited by aekzof; 05-03-2022, 11:38 AM.

    #2
    Hello aekzof,

    in barAgo is desincremented
    and each time have tested Close[barAgo ]
    sometimes barAgo exceeds 30
    so how do we test Close[30]? (example)
    In the given code the barsAgo is being subtracted on each loop so for it to test Close[30] that would require the upTrendEndBarsAgo to be 30 or greater.

    whereas normally we test the last bar that will close or cross the trend
    To clarify here, are you asking how to use the indicator as a signal so you could check the last bar value for crossings?
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply
      yes i have already posted this question
      and I got an answer and it works

      Comment


        #4
        I try to understand but it wants to enter my head
        it was. easy to do close[0] cross the trend?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chartchart, 05-19-2021, 04:14 PM
        3 responses
        577 views
        1 like
        Last Post NinjaTrader_Gaby  
        Started by bsbisme, Yesterday, 02:08 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by prdecast, Today, 06:07 AM
        0 responses
        3 views
        0 likes
        Last Post prdecast  
        Started by i019945nj, 12-14-2023, 06:41 AM
        3 responses
        60 views
        0 likes
        Last Post i019945nj  
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        18 views
        0 likes
        Last Post TraderBCL  
        Working...
        X