Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Can anyone convert a code from TOS
Updated July 19, 2012
Top Posters
looks_one
j8fire
with 3 posts (0 thanks)
looks_two
Fat Tails
with 2 posts (2 thanks)
looks_3
Big Mike
with 1 posts (1 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
5,188 views
thumb_up
3 thanks given
group
4 followers
forum
8 posts
attach_file
2 attachments
Can anyone convert a code from TOS
June 22nd, 2010, 10:25 PM
texas
Posts: 3 since Dec 2009
Thanks Given: 1
Thanks Received: 0
Hi I have a script on TOS that i would like to convert to ninjatrader any help would be great. thanks
#
# (for use with Trading Strategy "DX X-ing 30"
#
declare lower;
input length = 14;
def hiDiff = high - high[1];
def loDiff = low[1] - low;
def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM = if loDiff > hiDiff and loDiff > 0 then loDiff else 0;
def ATR = WildersAverage(TrueRange(high, close, low), length);
def "DI+" = 100 * WildersAverage(plusDM, length) / ATR;
def "DI-" = 100 * WildersAverage(minusDM, length) / ATR;
def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-") / ("DI+" + "DI-") else 0;
plot "DX" = DX;
plot "30-Line" = 30;
"DX".SetDefaultColor(COLOR.White);
"30-Line".SetDefaultColor(COLOR.Red);
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
June 23rd, 2010, 02:31 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
Just try the DMI indicator of NinjaTrader . You may want to add one line to the code to display the threshold line.
Code
Add (new Line ( Color . Red , 30 , "30-Line" ));
June 23rd, 2010, 04:36 AM
texas
Posts: 3 since Dec 2009
Thanks Given: 1
Thanks Received: 0
what i want is a positive value always between 0 and 100 and gives me a arrow on the candle when it crosses 30 it is close but not quite there
June 23rd, 2010, 08:32 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
Your indicator looks like a simple ADX. If you add a line at 30 and draw a diamond, when ADX exceeds 30 you would be done.
j8fire
what i want is a positive value always between 0 and 100 and gives me a arrow on the candle when it crosses 30 it is close but not quite there
Attached Files
Elite Membership required to download: ADX2.zip
June 24th, 2010, 08:28 AM
texas
Posts: 3 since Dec 2009
Thanks Given: 1
Thanks Received: 0
THANKS,
I dont have any coding skill I did look at the code thinking it would be a easy just to add the equation but got confuse with all the info i saw did not want to jack it up.
so many thanks.
July 15th, 2011, 02:08 AM
New York City, USA
Experience: Advanced
Platform: NinjaTrader
Trading: ES, CL, 6E
Posts: 149 since Jun 2010
Thanks Given: 81
Thanks Received: 42
Hi guys, I have a nice triple keltner channel that is for TOS i'd like to get it on Ninjatrader and also MT4
can anyone help?
Code
declare weak_volume_dependency;
input displace = 0;
input displace2 = 0;
input displace3 = 0;
input factor = 1.75;
input factor2 = 2.5;
input factor3 = 4;
input length = 45;
input price = close;
def shift = factor * AvgTrueRange(high, close, low, length);
def shift2 = factor2 * AvgTrueRange(high, close, low, length);
def shift3 = factor3 * AvgTrueRange(high, close, low, length);
def average = ExpAverage(price, length);
plot Avg = average[-displace];
Avg.SetDefaultColor(GetColor(7));
plot Upper_Band = average[-displace] + shift[-displace];
Upper_Band.SetDefaultColor(GetColor(7));
plot Lower_Band = average[-displace] - shift[-displace];
Lower_Band.SetDefaultColor(GetColor(7));
plot Upper_Band2 = average[-displace] + shift2[-displace];
Upper_Band2.SetDefaultColor(GetColor(7));
plot Lower_Band2 = average[-displace] - shift2[-displace];
Lower_Band2.SetDefaultColor(GetColor(7));
plot Upper_Band3 = average[-displace] + shift3[-displace];
Upper_Band3.SetDefaultColor(GetColor(7));
plot Lower_Band3 = average[-displace] - shift3[-displace];
Lower_Band3.SetDefaultColor(GetColor(7));
July 18th, 2012, 10:25 AM
Manchester, England
Experience: Beginner
Platform: NinjaTrader, Multicharts
Broker: Mirus/Zenfire
Trading: NQ,ES
Posts: 7 since Apr 2010
Thanks Given: 44
Thanks Received: 1
Hi all,
is there anyone who can help me to convert this TOS code into Tradestation, please ?
Basically it is code to show NYSE and Nasdaq breadth into charts.
See picture.
Here is TOS code:
Code
#--------------------------------------
#NYSE AND NASDAQ BREADTH BUBBLE SCRIPT
#--------------------------------------
input length = 2;
#NYSE Breath ratio
def NYSEratio = if (close("$UVOL") >= close("$DVOL")) then (close("$UVOL") / close("$DVOL")) else -( close("$DVOL") / close("$UVOL")) ;
plot NYratio = round(NYSEratio, length);
NYratio.DefineColor("NYSEup", color.UpTICK);
NYratio.DefineColor("NYSEdown", color.DownTICK);
NYratio.AssignValueColor(if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown"));
AddChartLabel(yes, concat(NYratio, " :1 NYSE"), (if NYSEratio >= 0 then NYratio.color("NYSEup") else NYratio.color("NYSEdown")));
#Nasdaq Breath ratio
def NASDratio = if (close("$UVOL/Q") >= close("$DVOL/Q")) then (close("$UVOL/Q") / close("$DVOL/Q")) else -( close("$DVOL/Q") / close("$UVOL/Q")) ;
plot Qratio = round(NASDratio, length);
Qratio.DefineColor("NASup", color.UpTICK);
Qratio.DefineColor("NASdown", color.DownTICK);
Qratio.AssignValueColor(if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown"));
AddChartLabel(yes, concat(Qratio, " :1 NASD"), (if NASDratio >= 0 then Qratio.color("NASup") else Qratio.color("NASdown")));
#ZeroLine
plot zeroline = 0;
zeroline.assignValueColor(if NYSEratio > NYSEratio[1] then color.GREEN else color.RED);
zeroline.setLineWeight(1);
zeroline.hideTitle();
zeroline.hideBubble();
Thank you.
Peter
July 18th, 2012, 08:24 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599
@PedroMAN , you might want to also post here:
Mike
Last Updated on July 18, 2012