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:	64
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 dweems, Yesterday, 02:11 PM
        1 response
        46 views
        0 likes
        Last Post NinjaTrader_Angelica  
        Started by Skechers, Today, 02:31 PM
        2 responses
        34 views
        0 likes
        Last Post Skechers  
        Started by njmeyer713, Today, 04:10 PM
        0 responses
        20 views
        0 likes
        Last Post njmeyer713  
        Started by ラリー, 10-03-2022, 09:32 PM
        7 responses
        131 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Tonofit, Today, 01:03 PM
        1 response
        25 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X