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 DJ888, Yesterday, 10:57 PM
    0 responses
    6 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Yesterday, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X