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

Error on first line?

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

    Error on first line?

    The error on the first line says

    line 1 - Expected class, delegate, enum, interface or structure
    lin 0 - ] expected


    [LegacyColorValue = true;]


    { _SHME_Dynamic_SR - draw dynamic s/rlines for the period - periods auto calculated }


    {Programmer: Avery T. Horton, Jr. aka TheRumpledOne}

    inputs:


    iMode("No"), { if "auto" code sets xPeriods, if not "auto" code uses iPeriods}

    iPeriods(05),
    HighColor( red),
    LowColor( blue) ;

    variables:

    xPeriods(60),
    xInterval(0),
    sFirstPass(true),
    HavePrevLines( false ),
    TLHigh( 0 ),
    TLLow( 0 ),
    PushHigh( 0 ),
    PushLow( 0 ),
    OldPushHigh( 0 ),
    OldPushLow( 0 ),
    PrevPushHigh( 0 ),
    PrevPushLow( 0 ) ;


    {first time through}

    if sFirstPass
    then begin

    sFirstPass = false;

    {bar test}

    If bartype = 4
    then xInterval = 94
    else
    If bartype = 3
    then xInterval = 93
    else
    If bartype = 2
    then xInterval = 92
    else
    If bartype = 1
    then begin
    xInterval = BarInterval;
    end; { If bartype = 1 }

    {mode test}

    If iMode <> "Auto" and iMode <> "auto" and iMode <> "AUTO"
    then xPeriods = iPeriods
    else xPeriods = _fPushPeriods(xInterval);

    end; {if sFirstPass}

    {save old values}

    If PushHigh <> PrevPushHigh
    then OldPushHigh = PrevPushHigh;

    If PushLow <> PrevPushLow
    then OldPushLow = PrevPushLow ;

    OldPushHigh = PrevPushHigh ;
    OldPushLow = PrevPushLow ;

    PrevPushHigh = PushHigh ;
    PrevPushLow = PushLow ;

    { high / low for period }

    PushHigh = Highest( H, xPeriods);
    PushLow = Lowest( L, xPeriods) ;

    If PushHigh <> H
    and PushHigh < PrevPushHigh
    then PushHigh = PrevPushHigh;

    If PushLow <> L
    and PushLow > PrevPushLow
    then PushLow = PrevPushLow;

    plot1(PushLow, "PushLow", LowColor);

    plot2(PushHigh, "PushHigh", HighColor);

    #2
    Unfortunately we can not help since this is NOT NinjaScript code.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rhyminkevin, Today, 04:58 PM
    0 responses
    5 views
    0 likes
    Last Post rhyminkevin  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    5 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    12 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    47 views
    0 likes
    Last Post futtrader  
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    15 views
    0 likes
    Last Post bltdavid  
    Working...
    X