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

The TMV

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

    The TMV

    I would like to have the TMV on ninjatrader. I first learned about it on tos. I have found that it works very well on trending days and even on the chops. Basically it could tell you when its time to exit a trade, but only with the actual SPX, not the ES, and not so much when to enter on the chop. I don't know if this is the correct forum or if I am allowed to post the code, but here it is

    input price = close;
    input keltnerLength = 13;
    input volumeFastLength = 1;
    input volumeSlowLength = 20;
    input ADXLength = 10;
    input SMALength = 8;
    input volumeOscThreshold = 0.5;
    input paintBars = yes;

    def keltnerSMA = Average(hlc3, keltnerLength);
    def avgRange = Average(high - low, keltnerLength);
    def volumeOsc = reference VolumeOsc("fast length" = volumeFastLength, "slow length" = volumeSlowLength, "diff type" = "percent");
    def ADX = reference ADX(ADXLength, AverageType.WILDERS);
    def SMA = Average(price, SMALength);

    plot KeltnerHigh = keltnerSMA + avgRange;
    plot KeltnerMid = keltnerSMA;
    plot KeltnerLow = keltnerSMA - avgRange;
    plot VolumeSpike = volumeOsc > volumeOscThreshold;

    KeltnerHigh.SetDefaultColor(GetColor(4));
    KeltnerMid.SetDefaultColor(GetColor(4));
    KeltnerMid.SetStyle(Curve.LONG_DASH);
    KeltnerLow.SetDefaultColor(GetColor(4));
    VolumeSpike.SetDefaultColor(GetColor(1));
    VolumeSpike.SetLineWeight(3);
    VolumeSpike.SetPaintingStrategy(PaintingStrategy.B OOLEAN_POINTS);

    DefineGlobalColor("Up", Color.UPTICK);
    DefineGlobalColor("Neutral", Color.GRAY);
    DefineGlobalColor("Down", Color.DOWNTICK);
    AssignPriceColor( if !paintBars
    then Color.CURRENT
    else if ADX > ADX[1] and price > SMA
    then globalColor("Up")
    else if ADX > ADX[1] and price < SMA
    then globalColor("Down")
    else globalColor("Neutral"));

    #2
    Originally posted by marketvoyager View Post
    I would like to have the TMV on ninjatrader. I first learned about it on tos. I have found that it works very well on trending days and even on the chops. Basically it could tell you when its time to exit a trade, but only with the actual SPX, not the ES, and not so much when to enter on the chop. I don't know if this is the correct forum or if I am allowed to post the code, but here it is

    input price = close;
    input keltnerLength = 13;
    input volumeFastLength = 1;
    input volumeSlowLength = 20;
    input ADXLength = 10;
    input SMALength = 8;
    input volumeOscThreshold = 0.5;
    input paintBars = yes;

    def keltnerSMA = Average(hlc3, keltnerLength);
    def avgRange = Average(high - low, keltnerLength);
    def volumeOsc = reference VolumeOsc("fast length" = volumeFastLength, "slow length" = volumeSlowLength, "diff type" = "percent");
    def ADX = reference ADX(ADXLength, AverageType.WILDERS);
    def SMA = Average(price, SMALength);

    plot KeltnerHigh = keltnerSMA + avgRange;
    plot KeltnerMid = keltnerSMA;
    plot KeltnerLow = keltnerSMA - avgRange;
    plot VolumeSpike = volumeOsc > volumeOscThreshold;

    KeltnerHigh.SetDefaultColor(GetColor(4));
    KeltnerMid.SetDefaultColor(GetColor(4));
    KeltnerMid.SetStyle(Curve.LONG_DASH);
    KeltnerLow.SetDefaultColor(GetColor(4));
    VolumeSpike.SetDefaultColor(GetColor(1));
    VolumeSpike.SetLineWeight(3);
    VolumeSpike.SetPaintingStrategy(PaintingStrategy.B OOLEAN_POINTS);

    DefineGlobalColor("Up", Color.UPTICK);
    DefineGlobalColor("Neutral", Color.GRAY);
    DefineGlobalColor("Down", Color.DOWNTICK);
    AssignPriceColor( if !paintBars
    then Color.CURRENT
    else if ADX > ADX[1] and price > SMA
    then globalColor("Up")
    else if ADX > ADX[1] and price < SMA
    then globalColor("Down")
    else globalColor("Neutral"));

    Is this not it? here?

    Comment


      #3
      Hello marketvoyager,

      You can find the direct link to the TMV below.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,611 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      22 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X