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:	313
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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        45 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        31 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X