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)
thinkorswim Sharing
Using VSA with momo indicators: FW_MOBO Basic; Hull mov avg; TMV
and vol/deviation indicators: RelativeVolumeStDev and "volume at time of day".
When I paste the code, tos states that it's missing the code to plot it. Does anyone have the code to add for plotting it as a study? Thanks in advance!
I'm guessing you mean either the Red Arrow code at top of previous page, or the Green Arrow code below that. In the first case, remove the # from in front of any "plot" lines of code. In the second case, for any defs for which you'd like to see plots, add a line below the def that says: plot (make up a name) = (name of the def);
Also, these studies seem to only concern futures ("/xx"), not stocks or forex. But maybe you knew that.
jperales42, it's been almost a year and I lost track and now can't wrap my head around it. Sorry. If you want, please post which code is not doing what you want and say again what you want it to do? I know you want it as a study.
#hint: Plots a trend line between the two input dates, calculates and plots an extension, and alerts on trend line violation. Daily charts only.
#hint startDateYyyyMmDd: Select starting date of trend line.
#hint endDateYyyyMmDd: Select ending date of trend line.
#hint mode: Select an up trending or down trending line.
def start = if Getyyyymmdd() == startDateYyyyMmDd then 1 else 0;
def end = if GetYYYYMMDD() == endDateYyyyMmDd then 1 else 0;
rec startPrice = if start and mode == mode.upTrend then low else if start and mode == mode.downTrend then high else startPrice[1];
rec startBar = if start then BarNumber() else startBar[1];
rec endPrice = if end and mode == mode.upTrend then low else if end and mode == mode.downTrend then high else endPrice[1];
rec endBar = if end then BarNumber() else endBar[1];
plot trendLine = if start then startPrice else if end then endPrice else Double.NaN;
trendLine.EnableApproximation();
trendLine.AssignValueColor(if mode == mode.upTrend then GlobalColor("UpTrend") else GlobalColor("DownTrend"));
trendLine.SetLineWeight(2);
rec extend = if end and close then 1 else extend[1];
def slope = (endPrice - startPrice) / (endBar - startBar);
def trendLineViolation = if (mode == mode.upTrend and close < extension and close[1] > extension[1]) or (mode == mode.downTrend and close > extension and close[1] < extension[1]) then 1 else 0;
plot breach = if trendLineViolation then extension else Double.NaN;
breach.SetStyle(Curve.POINTS);
breach.AssignValueColor(if mode == mode.upTrend then Color.RED else Color.GREEN);
breach.SetLineWeight(5);
rec violated = if trendLineViolation[1] then 1 else violated[1];
extension.AssignValueColor(if violated then Color.GRAY else GlobalColor("Extension"));
Alert(trendLineViolation, Concat(GetSymbolPart(), " trend line violation"), Alert.BAR, Sound.Ring);
this code is missing something because it wont work, also i would like to use it for intraday charts if possible.