NexusFi: Find Your Edge


Home Menu

 





Need help with avoiding plot repetition in ThinkScript


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,143 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Need help with avoiding plot repetition in ThinkScript

  #1 (permalink)
Andrew2401
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);

Reply With Quote




Last Updated on March 27, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts