NexusFi: Find Your Edge


Home Menu

 





I want to convert this TOS indicator to Ninjatrader


Discussion in NinjaTrader

Updated
    1. trending_up 2,767 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

I want to convert this TOS indicator to Ninjatrader

  #1 (permalink)
Jam29628
Atlanta, Georgia
 
Posts: 1 since Dec 2021
Thanks Given: 0
Thanks Received: 0

Hey. is there anyone who can convert this TOS indicator over to Ninja trader





input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = {default "No", "On FullK", "On FullD", "On FullK & FullD"};

def lowest_k = Lowest(priceL, KPeriod);
def c1 = priceC - lowest_k;
def c2 = Highest(priceH, KPeriod) - lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;


def FullK = MovingAverage(averageType, FastK, slowing_period);
def FullD = MovingAverage(averageType, FullK, DPeriod);


def stochh = (if FullD > 55 then 1 else 0);
def stochl = (if FullD < 45 then 1 else 0);

def datah = (if FullK >= FullK[1] and FullK > FullK[-1] and FullD > 45 then high else Double.NaN);

def dataL = (if FullK <= FullK[1] and FullK < FullK[-1] and FullD < 55 then low else Double.NaN);

plot xdatah = datah ;
plot xdatal = dataL;

def sh = if !IsNaN(xdatah) then high else Double.NaN;
def sl = if !IsNaN(xdatal) then low else Double.NaN;
input showhilowline = yes;
plot stochupcd = if showhilowline == no then Double.NaN else if stochh == 1 then sh + .01 else Double.NEGATIVE_INFINITY;
stochupcd.EnableApproximation();
stochupcd.AssignValueColor(Color.YELLOW);
stochupcd.HideBubble();

plot stochdowncd = if showhilowline == no then Double.NaN else if stochl == 1 then sl - .02 else Double.NEGATIVE_INFINITY;
stochdowncd.EnableApproximation();
stochdowncd.AssignValueColor(Color.YELLOW);
stochdowncd.HideBubble();

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
 r3torcr0 
Buffalo NY
 
Experience: Beginner
Platform: NinjaTrader
Trading: Forex
Posts: 23 since Sep 2013
Thanks Given: 7
Thanks Received: 23


Jam29628 View Post
Hey. is there anyone who can convert this TOS indicator over to Ninja trader





input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = {default "No", "On FullK", "On FullD", "On FullK & FullD"};

def lowest_k = Lowest(priceL, KPeriod);
def c1 = priceC - lowest_k;
def c2 = Highest(priceH, KPeriod) - lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;


def FullK = MovingAverage(averageType, FastK, slowing_period);
def FullD = MovingAverage(averageType, FullK, DPeriod);


def stochh = (if FullD > 55 then 1 else 0);
def stochl = (if FullD < 45 then 1 else 0);

def datah = (if FullK >= FullK[1] and FullK > FullK[-1] and FullD > 45 then high else Double.NaN);

def dataL = (if FullK <= FullK[1] and FullK < FullK[-1] and FullD < 55 then low else Double.NaN);

plot xdatah = datah ;
plot xdatal = dataL;

def sh = if !IsNaN(xdatah) then high else Double.NaN;
def sl = if !IsNaN(xdatal) then low else Double.NaN;
input showhilowline = yes;
plot stochupcd = if showhilowline == no then Double.NaN else if stochh == 1 then sh + .01 else Double.NEGATIVE_INFINITY;
stochupcd.EnableApproximation();
stochupcd.AssignValueColor(Color.YELLOW);
stochupcd.HideBubble();

plot stochdowncd = if showhilowline == no then Double.NaN else if stochl == 1 then sl - .02 else Double.NEGATIVE_INFINITY;
stochdowncd.EnableApproximation();
stochdowncd.AssignValueColor(Color.YELLOW);
stochdowncd.HideBubble();

Do you have a screen shot of it?

Follow me on Twitter Reply With Quote
  #3 (permalink)
 Apollo11 
KualaLumpur + Malaysia
 
Experience: Intermediate
Platform: TradeStation
Trading: ES, Forex, Futures, Stocks
Posts: 5 since Sep 2015
Thanks Given: 0
Thanks Received: 5


NinjaTrader has stochastic as well. Recommend you have a look there first. Does not make sense to program something in ninja … that ninja already has.

Reply With Quote




Last Updated on March 7, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts