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 pechtri, 06-22-2023, 02:31 AM
      10 responses
      124 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Yesterday, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Yesterday, 03:01 PM
      2 responses
      22 views
      0 likes
      Last Post helpwanted  
      Working...
      X