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

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 Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,767 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    7 views
    0 likes
    Last Post rocketman7  
    Working...
    X