DeltaMa Indicator For ThinkOrSwim

mbarcala

Active member
This is DeltaMa Indicator from Tradingview converted to TOS, Enjoy!
Original Link: https://www.tradingview.com/script/NSDtsAQX-DeltaMa/

Photo
13497[/ATTACH]']
KFgG9ld.png


script
Code:
#DeltaMa converted from Tradingview by mbarcala
#original link: https://www.tradingview.com/script/NSDtsAQX-DeltaMa/
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © Indyan
#//@version=4
#study("DeltaMa")

declare lower;

input length = 20;

def smooth = ExpAverage(close, length);

plot emaroc = 100 * (smooth - smooth[5]) / smooth[5];
emaroc.AssignValueColor(if emaroc > 0 then Color.GREEN else if emaroc < 0 then Color.RED else Color.CURRENT);


plot cline = 0;
 

Attachments

  • KFgG9ld.png
    KFgG9ld.png
    188.5 KB · Views: 70
Last edited by a moderator:

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

This is DeltaMa Indicator from Tradingview converted to TOS, Enjoy!
here is an updated version
Code:
declare lower;

input length = 20;
input SigLength = 3;
input arrows = 0;
input dotsize = 3;
input APC = 0;
def smooth = ExpAverage(close, length);
plot emaroc = 100 * (smooth - smooth[5]) / smooth[5];
emaroc.setdefaultColor(Color.Cyan);
emaroc.SetLineWeight(2);
emaroc.HideBubble();
Plot Signal = ExpAverage(emaroc,Siglength);
Signal.SetdefaultColor(Color.Magenta);
signal.SetLineWeight(2);
plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
AddCloud(emaroc,Signal,Color.Cyan,Color.Magenta);
def Mmax= Max(emaroc,Signal);
def MMin= Min(emaroc,Signal);
AddCloud(MMin,0,Color.green,Color.Black);
AddCloud(Mmax,0,Color.Black,Color.Red);
Def Con1 = emaroc >= 0;
Def Con2 = emaroc < 0;
Def Con3 = emaroc > emaroc [1];
Def Con4 = emaroc < emaroc [1];

Plot BullRise = If Con1 and Con3 then MMin else 0;
BullRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BullRise.SetDefaultColor(Color.Green);
BullRise.SetLineWeight(3);
Plot BullFall = if Con1 and Con4 then MMin else 0;
BullFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BullFall.SetDefaultColor(Color.Dark_Green);
BullFall.SetLineWeight(3);
Plot BearFall = if Con2 and Con4 then MMax else 0;
BearFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BearFall.SetDefaultColor(Color.Dark_Red);
BearFall.SetLineWeight(3);
Plot BearRise = if Con2 and Con3 then Mmax else 0;
BearRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BearRise.SetDefaultColor(Color.Red);
BEarRise.SetLineWeight(3);

Plot UZ = Average(emaroc,34) + (1.3185*StDev(emaroc,34));
UZ.SetPaintingStrategy(PaintingStrategy.Line);
UZ.SetLineWeight(2);
UZ.SetDefaultColor(Color.Yellow);
Plot LZ = Average(emaroc,34) - (1.3185*StDev(emaroc,34));
LZ.SetPaintingStrategy(PaintingStrategy.Line);
LZ.SetLineWeight(2);
LZ.SetDefaultColor(Color.Yellow);

#ARROWS
plot ArrowDown = if arrows and (emaroc Crosses below Signal) then Signal else double.nan;
ArrowDown.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown.setDefaultColor(color.Magenta);
ArrowDown.setLineWeight(dotsize);

plot ArrowUp = if arrows and (emaroc crosses above Signal) then signal else double.nan;
ArrowUp.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp.setDefaultColor(color.Cyan);
ArrowUp.setLineWeight(dotsize);

plot ArrowDown2 = if arrows and (emaroc Crosses below 0) then 0 else double.nan;
ArrowDown2.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown2.setDefaultColor(color.Red);
ArrowDown2.setLineWeight(dotsize);

plot ArrowUp2 = if arrows and (emaroc crosses above 0 ) then 0 else double.nan;
ArrowUp2.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp2.setDefaultColor(color.Blue);
ArrowUp2.setLineWeight(dotsize);

plot ArrowDown3 = if arrows and (emaroc Crosses below UZ) then UZ else double.nan;
ArrowDown3.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown3.setDefaultColor(color.Yellow);
ArrowDown3.setLineWeight(dotsize);

plot ArrowUp3 = if arrows and (emaroc crosses above LZ ) then LZ else double.nan;
ArrowUp3.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp3.setDefaultColor(color.Yellow);
ArrowUp3.setLineWeight(dotsize);

AssignPriceColor( if APC ==1 and emaroc >= signal then Color.Cyan else if APC == 1 and emaroc < Signal then Color.Magenta else If APC ==2 and emaroc >=0 then Color.Green else If APC ==2 and emaroc <0 then Color.Red else Color.Current);

xlqS0DC.png
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
434 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