• Get $40 off VIP by signing up for a free account! Sign Up

My script will not show past signals only most recent

Nura

New member
Hello,
I have this script that plots an arrow on the chart when extensions from moving averages and other simple criteria are met, the problem is that when the criteria is triggered the past arrows that were triggered on the chart just disappear, so I can not for sure see how accurate the indicator works unless I remember all the times it was triggered. Only shows the most recent trigger. Is this possible?

EXAMPLE:
https://gyazo.com/f993150fd50894945f64dd5f2196404c

SCRIPT:

Code:
input period_Type55 = AggregationPeriod.MIN;

input period_type27 = AggregationPeriod.DAY;



def begin = high(period = period_type27);

def end = high(period = period_Type55);

def NetChg = end - begin;

def PctChg = (end / begin) - 1;











input period_Type3 = AggregationPeriod.MIN;



plot DailyClose = close(period = PERIOD_TYPE27)[1];

def begin1 = close(period = period_Type3);

def end1 = high(period = period_Type3);

def NetChg1 = end1 - DailyClose;

def PctChg1 = (end1 / DailyClose) - 1;













input period_Type2 = AggregationPeriod.MIN;

input price2 = close;

input length2 = 72;

input displace2 = 0;

input showBreakoutSignals = no;



plot AvgExp2 = ExpAverage(price2[-displace2], length2);



plot DailyClose2 = close(period = ”DAY”)[1];

def begin2 = close(period = period_Type2);

def end2 = high(period = period_Type2);

def NetChg2 = end2 - AvgExp2;

def PctChg2 = (end2 / AvgExp2) - 1;



















input period_Type4 = AggregationPeriod.MIN;

input price3 = close;

input length3 = 9;

input displace3 = 0;

input showBreakoutSignals3 = no;



plot AvgExp3 = ExpAverage(price3[-displace3], length3);



plot DailyClose3 = close(period = ”DAY”)[1];

def begin3 = close(period = period_Type4);

def end3 = high(period = period_Type4);

def NetChg3 = end3 - AvgExp3;

def PctChg3 = (end3 / AvgExp3) - 1;











plot ArrowUp = if (PctChg3 > 0.05 and PctChg2 > 0.13 and PctChg1 > 0.20 and PctChg > -0.15 )

               then high

               else Double.NaN;









ArrowUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

ArrowUp.SetLineWeight(3);

ArrowUp.SetDefaultColor(Color.RED);



Alert(ArrowUP, " ", Alert.Bar, Sound.Bell);
 
Hello,
I have this script that plots an arrow on the chart when extensions from moving averages and other simple criteria are met, the problem is that when the criteria is triggered the past arrows that were triggered on the chart just disappear, so I can not for sure see how accurate the indicator works unless I remember all the times it was triggered. Only shows the most recent trigger. Is this possible?

EXAMPLE:
https://gyazo.com/f993150fd50894945f64dd5f2196404c

SCRIPT:

Code:
input period_Type55 = AggregationPeriod.MIN;

input period_type27 = AggregationPeriod.DAY;



def begin = high(period = period_type27);

def end = high(period = period_Type55);

def NetChg = end - begin;

def PctChg = (end / begin) - 1;











input period_Type3 = AggregationPeriod.MIN;



plot DailyClose = close(period = PERIOD_TYPE27)[1];

def begin1 = close(period = period_Type3);

def end1 = high(period = period_Type3);

def NetChg1 = end1 - DailyClose;

def PctChg1 = (end1 / DailyClose) - 1;













input period_Type2 = AggregationPeriod.MIN;

input price2 = close;

input length2 = 72;

input displace2 = 0;

input showBreakoutSignals = no;



plot AvgExp2 = ExpAverage(price2[-displace2], length2);



plot DailyClose2 = close(period = ”DAY”)[1];

def begin2 = close(period = period_Type2);

def end2 = high(period = period_Type2);

def NetChg2 = end2 - AvgExp2;

def PctChg2 = (end2 / AvgExp2) - 1;



















input period_Type4 = AggregationPeriod.MIN;

input price3 = close;

input length3 = 9;

input displace3 = 0;

input showBreakoutSignals3 = no;



plot AvgExp3 = ExpAverage(price3[-displace3], length3);



plot DailyClose3 = close(period = ”DAY”)[1];

def begin3 = close(period = period_Type4);

def end3 = high(period = period_Type4);

def NetChg3 = end3 - AvgExp3;

def PctChg3 = (end3 / AvgExp3) - 1;











plot ArrowUp = if (PctChg3 > 0.05 and PctChg2 > 0.13 and PctChg1 > 0.20 and PctChg > -0.15 )

               then high

               else Double.NaN;









ArrowUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

ArrowUp.SetLineWeight(3);

ArrowUp.SetDefaultColor(Color.RED);



Alert(ArrowUP, " ", Alert.Bar, Sound.Bell);

Is the above your last code as it has an arrow UP but the arrows in your picture are pointing DOWN? Using the above, I got more arrows using the above code than in your picture.

Changing the following line got more arrows. It produces the Devloping High for the day, whereas your code will use the Final High for the day. This will likely cause arrows to disappear while you were actively watching the chart as the high of the day was Developing, which will likely be less than the Final High of the day on the days where the arrows disappeared.

Ruby:
def begin = if getday()!=getday()[1] then high else max(high,begin[1]);# high(period = period_type27);
 
Hi @SleepyZ. Just wanted to clarify - will the line you mentioned above be able to show all historical arrows that have disappeared?

Thanks!

The arrows will remain as shown in the following code

Ruby:
def l   = if GetDay() != GetDay()[1] then low else Min(low, l[1]);
plot ll = l;
plot arrowl = if low < l[1] then 1 else 0;
arrowl.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

def h   = if GetDay() != GetDay()[1] then high else Max(high, h[1]);
plot hh = h;
plot arrowh = if high > h[1] then 1 else 0;
arrowh.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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