Thank you tomsk.
Hi @HighBredCloud will get Scaff in by this weekend, and will try to see how to best represent the relative volume.@diazlaz wow...how the heck did I miss all of this? I was still paying attention to the other thread patiently awaiting updates that happened few days ago...Just to be clear...everything that you update is all on this thread moving forward? I will test out the newest update in post #3...Just curious if you plan on releasing more updates to this such as the Relative Volume by Mobius or the Schaff Trend Cycle? Terrific job once again.
Correct is best to comment them out, as it's still being evaluated. it's slightly less since the enable flag will reduce the processing, but try it and see if disabling improves it, or then better off commenting it. from experience, on intel with 8GB, i5 or greater it has no issues running multiple charts with this indicator enabled.@BenTen To prevent the slowing down...and lagging is it best to comment out the studies not used in the CSA vs deleting them from the script itself? I don't think selecting NO on the studies not being used will help with the lag...
@diazlaz Sounds good...I will give that a try...In regards to relative volume indicator by Mobius in the code below...IMO the upper study and how it colors the candles would be the most important with the combination of other supertrends already in the CSA. I do not think the lower volume study is necessary. Let me know if you need the Schaff Trend script again the one that has the MA built in so that you can establish the correct logic when you code.Hi @HighBredCloud will get Scaff in by this weekend, and will try to see how to best represent the relative volume.
# Volume Comparison
# Plots Yesterdays Total Volume At Same Bar and Average Volume At Same Bar
# Mobius
# V02.06.2018 Posted to Chat Room 07.13.2018
# tomsk added Alert when today's volume/avgVol > 300%, 1.17.2020
# Plots a comparison of yesterdays total volume at the same bar
# and compares an average volume to the same time yesterday.
declare on_volume;
input avgLength = 10;
def v = volume;
def vD = volume(period = AggregationPeriod.Day);
def c = close;
def x = BarNumber();
def nan = double.nan;
def RTHbar1 = if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
then x
else RTHbar1[1];
def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
GetTime() <= RegularTradingEnd(GetYYYYMMDD());
def PrevRTHbar1 = if RTHbar1 != RTHbar1[1]
then RTHbar1[1]
else PrevRTHbar1[1];
def indexBar = RTHbar1 - PrevRTHbar1;
plot prevVol = if IsNaN(c)
then nan
else GetValue(v, indexBar);
prevVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
prevVol.SetDefaultColor(CreateColor(75, 75, 75));
prevVol.SetLineWeight(1);
plot Vol = v;
Vol.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Vol.AssignValueColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
AssignPriceColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
def avgPrev = Average(prevVol, avgLength);
def avgCurr = Average(Vol, avgLength);
def prevDailyVol = if RTH and !RTH[1]
then getValue(v, indexBar)
else if RTH
then compoundValue(1, prevDailyVol[1] + GetValue(v, indexBar), GetValue(v, indexBar))
else prevDailyVol[1];
AddLabel(1, "Prev D Vol = " + prevDailyVol +
" Prev Vol avg(" + avgLength + ") = " + Round(avgPrev, 0), prevVol.TakeValueColor());
AddLabel(1, "Current D Vol = " + vD +
" Curr Vol avg(" + avgLength + ") = " + Round(avgCurr, 0), if vD > prevDailyVol
then color.green
else color.red);
Alert(vD/avgCurr > 3, "Daily Volume > 300% AvgVol", Alert.BAR, Sound.Ring);
# End Code Volume Comparison
#CSA - trend, a momentum and a cycle based indicator for ThinkorSwim V3.2
#
#VERSION
# 2020.02.01 V3.2 @diazlaz - Added SWCA - Schaff Wave CrossOver Average
@diazlaz WOW...it looks like you were able to incorporate EVERYTHING into this not just the Schaff Wave crossing over the MA...I cannot wait to test this as this indicator is very accurate and keeps you in the trade.V3.2 Released
@HighBredCloud Schaff Wave CrossOver Average Release in V3.2
Code:#CSA - trend, a momentum and a cycle based indicator for ThinkorSwim V3.2 # #VERSION # 2020.02.01 V3.2 @diazlaz - Added SWCA - Schaff Wave CrossOver Average
https://usethinkscript.com/threads/...cycle-trading-system-v3-0-csa.1596/post-14867
Please review the logic of the module, and let me know if you need any changes to it.
Yes, correct. I've tried to decouple the modules and namespace to allow for extensions and version control.@diazlaz WOW...it looks like you were able to incorporate EVERYTHING into this not just the Schaff Wave crossing over the MA...I cannot wait to test this as this indicator is very accurate and keeps you in the trade.
I will also experiment with what you suggested in post number #51...I run this CSA on 6 charts per monitor AND per each TOS instance...and I am running 4 instances of TOS in addition to a separate TMO SuperTrend and Heikin Ashi that I made for an exit indicator...So I might be stretching the limits of the performance...If commenting out the studies not being used is a way to help with performance and reduce lag than its a great thing to know.
Also...I have seen you list in post #6 what appears to be an individual study of the CSA...I am assuming that so people can make their own CSA in what indicators they want to use to avoid performance issues we are talking about?
input movAvg1_Price = close;
input movAvg2_Price = close;
input movAvg1_Length = 55;
input movAvg2_Length = 55;
input movAvg1_Displace = 0;
input movAvg2_Displace = -1;
input showMovAvgLines = { default "yes","no"};
def HMA1 = MovingAverage(AverageType.HULL, movAvg1_Price, movAvg1_Length)[-movAvg1_Displace];
def HMA2 = MovingAverage(AverageType.HULL, movAvg2_Price, movAvg2_Length)[-movAvg2_Displace];
plot line1 = if !showMovAvgLines then HMA1 else double.nan;
line1.DefineColor("Up", GetColor(1));
line1.DefineColor("Down", GetColor(0));
line1.SetStyle(Curve.SHORT_DASH);
line1.AssignValueColor(if HMA1 > HMA1[1] then line1.color("Up" ) else line1.color("Down" ));
plot line2 = if !showMovAvgLines then HMA2 else double.nan;
line2.DefineColor("Up", GetColor(1));
line2.DefineColor("Down", GetColor(0));
line2.AssignValueColor(if HMA2 > HMA2[1] then line2.color("Up" ) else line2.color("Down" ));
def Upsignal = close crosses above line2;
def Downsignal = close crosses below line2;
alert(Upsignal,” Price Crossing UP ”,alert.BAR,sound.DING);
alert(Downsignal," Price Crossing DOWN ",alert.BAR,sound.DING);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.