Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TOS 2 NT7 indicator conversion request

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

    TOS 2 NT7 indicator conversion request

    Hi Ninjascripters,

    Can someone with C# experience please translate the following code from a TOS indicator i had created? It basically paints a constant line on a new panel at 0 (zeroline) which changes colors depending on the if-then-else criteria. I wrote them in TOS hacking off of the CCI woodies sidewinders but having a tough time getting it translated to NT. Perhaps you could provide me some initial code?

    Very much appreciated and thanks in advance!

    WSA

    ------------------
    input Momentum_length = 6;
    input Momentum_price = close;

    Assert(Momentum_length > 0, "'length' must be positive: " + Momentum_length);

    def Momentum = Momentum_price - Momentum_price[Momentum_length];

    plot Momentum_ZeroLine = if IsNaN(close) then Double.NaN else 0;

    Momentum_ZeroLine.SetPaintingStrategy(PaintingStra tegy.DASHES);
    Momentum_ZeroLine.DefineColor("Positive and Up", Color.GREEN);
    Momentum_ZeroLine.DefineColor("Negative and Down", Color.RED);
    Momentum_ZeroLine.SetLineWeight(3);
    Momentum_ZeroLine.HideTitle();
    Momentum_Zeroline.HideBubble();
    Momentum_ZeroLine.AssignValueColor(
    if Momentum > 0 then Momentum_ZeroLine.Color("Positive and Up")
    else if Momentum < 0 then Momentum_ZeroLine.Color("Negative and Down")
    else GetColor(7));

    -----------------------------

    #2
    Hello,

    I'll leave this open for others to assist with as well, but if you would prefer the assistance of a professional consultant please send mail to support [at] ninjatrader [dot] com

    We also have several educational resources available as well if you are interested in learning how to create your own indicators or strategies.

    Let me know which route you would like to go.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    598 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 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
    557 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X