Announcement

Collapse
No announcement yet.

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:	286
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?

    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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X