UpTwoBucks
Active member
Welcome to our ThinkScript tutorial where we explore the critical importance of creating custom buy and sell indicators based on your own unique trading strategy. In this video, we delve into the world of ThinkScript, a powerful scripting language used within ThinkorSwim, and discover how you can leverage its capabilities to gain a competitive edge in the financial markets.
Code:
# Created by Ricky_Gaspard 7-16-2023
#Buying and Selling Indicator Arrows for Scalping
# Buying Conditions
def buycondition1 = SimpleMovingAvg("length" = 5)."SMA" is greater than MovAvgExponential("length" = 10)."AvgExp" and MovAvgExponential("length" = 5)."AvgExp" is greater than MovAvgExponential("length" = 10)."AvgExp" and MovAvgExponential("length" = 5)."AvgExp" crosses above SimpleMovingAvg("length" = 5)."SMA";
#def buycondition2 =
#Selling Conditions
def sellcondition1 = MovAvgExponential("length" = 5)."AvgExp" crosses below MovAvgExponential("length" = 10)."AvgExp";
#def sellcondition2 =
#Determies Conditions of an UP Arrow
plot bullish = if buycondition1 then 1 else 0;
#Determies Conditions of a Down Arrow
plot bearish = if sellcondition1 then 1 else 0;
#Paints Up Arrow On Chart
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#Sets Default UP Arrow Color
bullish.SetDefaultColor(Color.white);
#Paints Down Arrow On Chart
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#Sets Default Down Arrow Color
bearish.SetDefaultColor(Color.WHITE);
#Sets Thickness of Arrows
bullish.SetLineWeight(3);
bearish.SetLineWeight(3);
Current DeskTop: http://tos.mx/61uIJpH