DMI Oscilator Watchlist


Category:
0
0

I am looking to finish my script for a DMI Oscilator Watchlist Alert. I hope someone might be able to finish it, since I am only missing the Sell Side when a green bar changes to red.

It intends to give a buy or sell signal as soon as the DMI Oscillator changes from green to red or the other way.

please email me @ [email protected]

input length = 10;
input paintBars = yes;
input averageType = AverageType.WILDERS;

def diPlus = DMI(length, averageType).”DI+”;
def diMinus = DMI(length, averageType).”DI-“;

plot osc = diPlus – diMinus;

AddLabel (yes,
if OSC < 0 then “Dn”
else if OSC[1] < 0 then “buy”
else “^”,color.black);

assignbackgroundcolor(
if OSC > 0 then color.light_green
else if OSC[1] > 0 then color.red
else color.pink);

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on March 1, 2019 5:44 pm
172 views
0
Private answer

Have you tried using the one I published? https://www.hahn-tech.com/thinkorswim-adx-dmi-watchlist/

 

Edit: Based on feedback from the author of the post I have the following solution.

There are errors in the last two lines of your code. Replace those last two lines of code with these:

AddLabel (yes, if osc < 0 then “Dn” else if osc > 0 then “buy” else “^”, Color.BLACK);
AssignBackgroundColor( if osc > 0 then Color.LIGHT_GREEN else if osc < 0 then Color.RED else Color.PINK);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 5, 2019 7:19 am
0
I've tried the solution, but it gives ADX signals... not DMI on the oscilator.
( at September 16, 2019 5:11 pm)
0
I have updated my answer to include the solution to your request.
( at September 16, 2019 6:00 pm)