Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

diogomattoso

Members
  • Content Count

    3
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    diogomattoso got a reaction from ja_trades in Jeff Augen's StdDev Price Change to NinjaTrader   
    Hi guys,
     
    Can anyone help me out by porting the following code originally made to ThinkorSwim to NinjaTrader? Here it is:
     
    declare lower;
    input length = 20;
    def closeLog = Log(close[1] / close[2]);
    def SDev = stdev(closeLog, length)* Sqrt(length / (length – 1));
    def m= SDev * close[1];
    plot spike = (close[0] – close[1]) / m;
    spike.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
    spike.AssignValueColor(if close > close[1] then Color.UPTICK else if close < close[1] then Color.DOWNTICK else GetColor(1));
     
    Thanks a lot!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.