SunWuKongMagic
New member
Just wanted to introduce myself.
I've been using ThinkScript lightly for about 6 months on Studies and Strategies. As well as some simple conditional orders on Exp moving Averages.
I'm looking at how I can set better stops in conditional orders eg with Stochastics.
At the moment I wait for good momentum then place a conditional sell on the following conditions
close < ExpAverage(close, 10)
or
close < ExpAverage(close, 5)
However this required close monitoring on my part to determine the conditions of momentum and the character of the stock.
My buy decisions are manual. based on news current technicals, Stochastics and MACD.
My go to stop otherwise is
close < ExpAverage(close, 50)
which is of course the final stop for investment while I bare the lost benefits of swing trades.
This is a recent strategy (below) I used to evaluate the its effectiveness. It is a simplified and modified version of one shared on this forum by the user Ajordan930
https://usethinkscript.com/threads/stoch-rsi-macd-bullish.21178/
With thanks, this allowed me to explore the concepts, learn and test it against the recent price action, in particular SOFI.
I have adjusted the oversold and underbought thresholds as sometimes the price action is too quick to register.
I am now looking into how I can better moderate this to remove the false hits, perhaps with the use of RSI, as with the original script. I am learning by building from simple foundations rather than just copying the whole thing. Like an art student copying the masters before finding my own style.
If anyone else has explored the use of conditional orders with Stochastics, I would be glad of the input as I'm a wee bit of a grommet on this.
I've been using ThinkScript lightly for about 6 months on Studies and Strategies. As well as some simple conditional orders on Exp moving Averages.
I'm looking at how I can set better stops in conditional orders eg with Stochastics.
At the moment I wait for good momentum then place a conditional sell on the following conditions
close < ExpAverage(close, 10)
or
close < ExpAverage(close, 5)
However this required close monitoring on my part to determine the conditions of momentum and the character of the stock.
My buy decisions are manual. based on news current technicals, Stochastics and MACD.
My go to stop otherwise is
close < ExpAverage(close, 50)
which is of course the final stop for investment while I bare the lost benefits of swing trades.
This is a recent strategy (below) I used to evaluate the its effectiveness. It is a simplified and modified version of one shared on this forum by the user Ajordan930
https://usethinkscript.com/threads/stoch-rsi-macd-bullish.21178/
With thanks, this allowed me to explore the concepts, learn and test it against the recent price action, in particular SOFI.
I have adjusted the oversold and underbought thresholds as sometimes the price action is too quick to register.
I am now looking into how I can better moderate this to remove the false hits, perhaps with the use of RSI, as with the original script. I am learning by building from simple foundations rather than just copying the whole thing. Like an art student copying the masters before finding my own style.
If anyone else has explored the use of conditional orders with Stochastics, I would be glad of the input as I'm a wee bit of a grommet on this.
Code:
# === Inputs ===
input slowKLength = 14;
input slowDLength = 3;
input maxLines = 10;
input UnderB = 30;
input OverS = 70;
# === Stochastic FullK ===
def fullK = reference StochasticFull(80,20,slowKLength, slowDLength,High, Low, Close,slowDLength, AverageType.SIMPLE).FullK;
# === Stochastic FullD ===
def fullD = reference StochasticFull(80,20,slowKLength, slowDLength,High, Low, Close,slowDLength, AverageType.SIMPLE).FullD;
# === Signal Logic ===
def bear = fullK > OverS and fullK <= fullD;
def bull = fullK < UnderB and fullK >= fullD;
def neutral = !bull and !bear;
# === Vertical Line Drawing with Limit ===
def signal = bull or bear;
def barCounter = if signal then barCounter[1] + 1 else barCounter[1];
def lastN = HighestAll(barCounter);
def showLine = barCounter >= lastN - maxLines;
AddVerticalLine(bull and showLine, "BULL", Color.GREEN, Curve.SHORT_DASH);
AddVerticalLine(bear and showLine, "BEAR", Color.RED, Curve.SHORT_DASH);
Last edited by a moderator: