A trend, momentum and cycle Trading System v3.0 (CSA)

hi @kelvin, the plot will be a boolean condition not value, try using the boolean painting strategy and see if it works for you.

PaintingStrategy.BOOLEAN_ARROW_UP and DOWN.

Thanks a lot, my coding ability is almost zero, I still can't figure out, can you please help me write correct code
 
That is one of the advantages of the CSA, by changing the thresholds you can completely develop trading plans and completely different approaches. the threshold will greatly change your results. I suggest you develop a plan and then tweak the indicator. you will need to refine it using your analysis and back-testing rules.
Yes the customization in modules is brilliant. If I were to use this I would need to see much more grey areas for regions where no trend was dominating. ??? I need long grey hold periods... I should use a ADX + a majority consensus of indicators before Uptrend or Downtrend (Any suggetions)
Some of those who contributed to earlier versions desired something to automate Buy&Sell orders so they used MACD and other things to paint over areas without weak trending momentum...
@diazlaz I am finding possible issues since I started reading this a few hours ago... The easiest error is that in TTM Trend you do not have a number of bars so it gives it's result instantaneously. Many of the indicators are not running properly and so it just says Red Candles are Red & Green Candles are Green... I think that frustrates some people so they fall back on their more visual indicators and put this on back-burner.

This picture was only possible after adding this line... Otherwise TTM is useless
Code:
Input enableTTM = yes;
input CompBars=6;
@diazlaz is this where improvements "bughunts" should go or have the contributors started another post?
This is a great project I think it needs testing!
After I get my footing for this and some of Mobius advice I will hear over and work on @YungTraderFromMontana suggestions... I am not on quarantine and my schedule is very poor. I think I really like all of you here and want to start contributing!
 
Gentlemen I stuggle with a very low confidence with the way Heikin Ashi is summed in this Architecture... I understand that time is happening all of the time and that the high Low Open Close does not necessarily make HA slower....

Do we need to walk through mathematics or does anyone know why HA is favored here???
Cause I am new and I don't get it...
 
Yes the customization in modules is brilliant. If I were to use this I would need to see much more grey areas for regions where no trend was dominating. ??? I need long grey hold periods... I should use a ADX + a majority consensus of indicators before Uptrend or Downtrend (Any suggetions)
Some of those who contributed to earlier versions desired something to automate Buy&Sell orders so they used MACD and other things to paint over areas without weak trending momentum...
@diazlaz I am finding possible issues since I started reading this a few hours ago... The easiest error is that in TTM Trend you do not have a number of bars so it gives it's result instantaneously. Many of the indicators are not running properly and so it just says Red Candles are Red & Green Candles are Green... I think that frustrates some people so they fall back on their more visual indicators and put this on back-burner.

This picture was only possible after adding this line... Otherwise TTM is useless
Code:
Input enableTTM = yes;
input CompBars=6;
@diazlaz is this where improvements "bughunts" should go or have the contributors started another post?
This is a great project I think it needs testing!
After I get my footing for this and some of Mobius advice I will hear over and work on @YungTraderFromMontana suggestions... I am not on quarantine and my schedule is very poor. I think I really like all of you here and want to start contributing!
thank you, any issues or requests please append them here in this thread. stay safe.
 
thank you, any issues or requests please append them here in this thread. stay safe.
Thank you Brother! I am going to open ToS up after dinner and keep going...
Before we walk-through Heikin Ashi we need to solve a simple equation to weigh out the scoring of Bull/Bear ratio
Code:
#####
#END OF MODULES
#####
# ADX TRENDING


#State

#def SResults=HA1_sState+HAMTF_sState ... I commented out all the lines of SResults####

def SBullish=HA1_sBullish+HAMTF_sBullish + ... +SWCA_sbullish
def SBearish=HA1_sBearish+HAMTF_sBearish + ... +SWCA_sBearish

Using Threshold as a tipping point on the scale and assigning a +100 or -100 bullish or bearish score needs to be replaced...
Code:
input displace=#;
Displace seems to just cut out some values based on their linear range but doesn't affect the final result of all modules combined...
If I had a computer learning set up I would replace the sBullish and sBearish with some dynamic weighted value...
For example ATR accounts for volatility so SuperTrend_sBullish would be higher rated >> than say HA_sBearish... No need to wait for TMO_sBearish to catch up to shut the trade off!!! :oops:
 
Thank you Brother! I am going to open ToS up after dinner and keep going...
Before we walk-through Heikin Ashi we need to solve a simple equation to weigh out the scoring of Bull/Bear ratio
Code:
#####
#END OF MODULES
#####
# ADX TRENDING


#State

#def SResults=HA1_sState+HAMTF_sState ... I commented out all the lines of SResults####

def SBullish=HA1_sBullish+HAMTF_sBullish + ... +SWCA_sbullish
def SBearish=HA1_sBearish+HAMTF_sBearish + ... +SWCA_sBearish

Using Threshold as a tipping point on the scale and assigning a +100 or -100 bullish or bearish score needs to be replaced...
Code:
input displace=#;
Displace seems to just cut out some values based on their linear range but doesn't affect the final result of all modules combined...
If I had a computer learning set up I would replace the sBullish and sBearish with some dynamic weighted value...
For example ATR accounts for volatility so SuperTrend_sBullish would be higher rated >> than say HA_sBearish... No need to wait for TMO_sBearish to catch up to shut the trade off!!! :oops:

How would you put the rating on the indicator tho? One thing that I did with the SuperTrend is set the ATR to .7 from 1.0...TMO combined with SuperTrend when both are going in the same direction can yield great results on certain timeframes. EXITS are something that need attention.
 
Thank you Brother! I am going to open ToS up after dinner and keep going...
Before we walk-through Heikin Ashi we need to solve a simple equation to weigh out the scoring of Bull/Bear ratio
Code:
#####
#END OF MODULES
#####
# ADX TRENDING


#State

#def SResults=HA1_sState+HAMTF_sState ... I commented out all the lines of SResults####

def SBullish=HA1_sBullish+HAMTF_sBullish + ... +SWCA_sbullish
def SBearish=HA1_sBearish+HAMTF_sBearish + ... +SWCA_sBearish

Using Threshold as a tipping point on the scale and assigning a +100 or -100 bullish or bearish score needs to be replaced...
Code:
input displace=#;
Displace seems to just cut out some values based on their linear range but doesn't affect the final result of all modules combined...
If I had a computer learning set up I would replace the sBullish and sBearish with some dynamic weighted value...
For example ATR accounts for volatility so SuperTrend_sBullish would be higher rated >> than say HA_sBearish... No need to wait for TMO_sBearish to catch up to shut the trade off!!! :oops:
the value of displace is to be able to set the colors of the button a number of signals to the left (prior bars), so that you can minimize volatility and trade with confirmation states (e.g. prior confirmation candles) - it's to help with whipsaw if you choose to focus on prior confirmed signals. it's not always 100% but can reduce the amount of signal change when trading higher timeframes.


if you have ideas on how to "weight" the indicators, please propose the formula and will see if and how we could apply it.
 
if you have ideas on how to "weight" the indicators, please propose the formula and will see if and how we could apply it.
@HighBredCloud For this week I could try weighing the Bullish and Bearish scores of each indicator as inputs you select... The odds of me choosing the correct combination with my human eyes are extremely low. If I wrote a Newtons method style ratio I will write each weight of the indicators that we find desirable (Maybe we select 8) and write profit of a strategy as a function of each indicator. Then I could set the computer to minimize losses by adjusting each weight. It would look like finding this curve with a series of lines. I know I can do this for us I have done such things before. https://en.wikipedia.org/wiki/Secant_method https://wikimedia.org/api/rest_v1/media/math/render/svg/93f178fd896cad8b93b2fa4e22880fb8fe29a28d

Help Me Narrow Down the needed data before I start Back-testing will need to include a range of possible scenarios and may take large computer resources... I am going to help! I will not spearhead projects to pester others!

TLDR NEWTONS Method where you set Losses to approach =0 Example: https://planetcalc.com/7748/ Or set P/L maximize... Even default excel can do this...
 
if you have ideas on how to "weight" the indicators, please propose the formula and will see if and how we could apply it.
The equations to optimize the inputs Weight_sBullish or Weight_sBearish would read Maximize: P/L
W2nd=W1st- [ f(W1st) / f'(W1st) ] , W3rd=W2nd - [f(W2nd) / f'(W2nd) ]
f(Wn)+f'(Wn)*[W(n+1)-Wn]= 0
And we know that for a range that the test could run P/L for the indicator once the weights have been narrowed down the computer can guess and guess and guess for conditions going back to 2001 hundreds of thousand of time until it recommends nearly perfect weights... But try to help me narrow down the weights we need... http://www.nabla.hr/FU-DerivativeF3.htm
This has tremendous opportunity I am to new and to shy to do autotrading but I would live within this architecture once tested... 🤑
 
Last edited:
@HighBredCloud For this week I could try weighing the Bullish and Bearish scores of each indicator as inputs you select... The odds of me choosing the correct combination with my human eyes are extremely low. If I wrote a Newtons method style ratio I will write each weight of the indicators that we find desirable (Maybe we select 8) and write profit of a strategy as a function of each indicator. Then I could set the computer to minimize losses by adjusting each weight. It would look like finding this curve with a series of lines. I know I can do this for us I have done such things before. https://en.wikipedia.org/wiki/Secant_method https://wikimedia.org/api/rest_v1/media/math/render/svg/93f178fd896cad8b93b2fa4e22880fb8fe29a28d

Help Me Narrow Down the needed data before I start Back-testing will need to include a range of possible scenarios and may take large computer resources... I am going to help! I will not spearhead projects to pester others!

TLDR NEWTONS Method where you set Losses to approach =0 Example: https://planetcalc.com/7748/ Or set P/L maximize... Even default excel can do this...

So you're basically looking for a list of indicators to conduct your back test...OK...That could be arranged.
 
the value of displace is to be able to set the colors of the button a number of signals to the left (prior bars), so that you can minimize volatility and trade with confirmation states (e.g. prior confirmation candles) - it's to help with whipsaw if you choose to focus on prior confirmed signals. it's not always 100% but can reduce the amount of signal change when trading higher timeframes.
Okay some waves are always going to be out of synch and a constant may be added to a sine wave function to align the timing of these functions without distorting time... This video from Khan Academy is very nice... I am not able to wrap my head around displace until I catch up wioth the other indicators https://www.khanacademy.org/science...onic-motion-ap/simple-pendulums-ap/v/pendulum
 
@diazlaz Hello - Do you have scan for #CSA - trend, a momentum and a cycle based indicator 3.2 ? That would be a great help.
YES! Once we finish the current work I will help do this... I realize the potential in these fundamentals you could literally live within this for the rest of your life no matter what the FED does in the middle of the day 🤑 ... What you need to do is have considerably more Grey areas... Scan to enter Grey areas and use the leading indicators like what @YungTraderFromMontana has been working on to determine direction while still with the grey areas and then Buy at Generous Prices!!!
So you literally need to scan to land on GREY with considerable pent up monetary energy... Like a coiling rattlesnake
 
YES! Once we finish the current work I will help do this... I realize the potential in these fundamentals you could literally live within this for the rest of your life no matter what the FED does in the middle of the day 🤑 ... What you need to do is have considerably more Grey areas... Scan to enter Grey areas and use the leading indicators like what @YungTraderFromMontana has been working on to determine direction while still with the grey areas and then Buy at Generous Prices!!!
So you literally need to scan to land on GREY with considerable pent up monetary energy... Like a coiling rattlesnake
looking forward to the collaboration. thanks and welcome.
 
can someone tell me what I am doing wrong? I copied the code on post 3 and it looks like nothing has changed with TOS?


y9A0VKT.png
 
Last edited:
This is a fantastic indicator! Is it not supposed to work higher time frame than 5min tho? My tos works flawlessly with this indicator on 1MIN and 5MIN chart but anything higher the indicator simply won't show up on chart.
 
YES! Once we finish the current work I will help do this... I realize the potential in these fundamentals you could literally live within this for the rest of your life no matter what the FED does in the middle of the day 🤑 ... What you need to do is have considerably more Grey areas... Scan to enter Grey areas and use the leading indicators like what @YungTraderFromMontana has been working on to determine direction while still with the grey areas and then Buy at Generous Prices!!!
So you literally need to scan to land on GREY with considerable pent up monetary energy... Like a coiling rattlesnake
@MattATM Thanks for the help.
 
This is a fantastic indicator! Is it not supposed to work higher time frame than 5min tho? My tos works flawlessly with this indicator on 1MIN and 5MIN chart but anything higher the indicator simply won't show up on chart.
Doesn't that Multi Time Frame MTF portion work with the Heikin Ashi portion? I am very close to removing that myself... I don't believe I understand why HA MTF is valid in this Architecture... I am waiting for someone to explain why they favor it??? i understand @YungTraderFromMontana use 4 smooth auto-trading... Maybe because the High to Low & Open to Close nature helps shift weight away from just falling all into just a default candle.
In addition to your minute aggregation period the displacement term is meant to smooth out the HA MTF buuut it only changes the window in the top of the screen... Does not change the final result :oops:
Code:
AddLabel(showlabels and enableHAMTF, "HA",
if IsNan(HAMTF_sState) then COLOR.DARK_GRAY else
if HAMTF_sState[-displace] > 0 then COLOR.GREEN else
if HAMTF_sState[-displace] < 0 then COLOR.RED
else COLOR.DARK_GRAY);
@hjc5812 I am working in the very short time frame... Because for the things spoken of looking on a 4 hour timeline won't let you see farther into the future it only deprives your computer information... A moving average line is worth zooming out to see the overall trend but here we are looking at immediate directions... What timeline and what kind of trading are you interested in @hjc5812 ???
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
344 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top