Boca Raton Florida
Posts: 3 since Mar 2017
Thanks Given: 2
Thanks Received: 0
|
Hi everybody!
I've run into a bit of an issue coding an alert system in ThinkScript (AD Ameritrade's Think or Swim System). Because the project is confidential, I can only share limited information, but I hope it can be enough to get some help. Basically, my script recognizes entry and exit points, and plots them into the charts as UP and DOWN arrows. It works just fine. The only thing I'm trying to fix is to block it from making multiple of the same arrows in a row. I thought I could set up some sort of ticker that activated when a green arrow was produced, and got deactivated when a red arrow was produced. Any ideas as to how? I appreciate any help. {Tried to post screenshots but couldn't because my account is too new. I'll send them in a message to whoever answers}
Here is as much of the script as I can share:
def BuySignal = {CONFIDENTIAL} then 1 else -1 ;
plot UpFractal = if BuySignal == 1 and BuySignal[1] != BuySignal then close else Double.NaN;
#Sell Signals
def SellSignal = if {CONFIDENTIAL} then 1 else -1;
plot DownFractal = if SellSignal == 1 and SellSignal[1] != SellSignal then close else Double.NaN;
UpFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
UpFractal.SetDefaultColor(GetColor(3));
UpFractal.SetLineWeight(2);
DownFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
DownFractal.SetDefaultColor(GetColor(3));
DownFractal.SetLineWeight(2);
|