Search found 18 matches

Go to advanced search

by chooka
Mon Feb 28, 2022 2:40 am
Forum: Pine Script Q&A
Topic: cannot calculate if MA20 and MA200 are close
Replies: 2
Views: 570
 
Jump to post

Re: cannot calculate if MA20 and MA200 are close

Hi there,

What you have coded looks to be working correctly.

I think the ratio limits you have chosen are far too wide (20%)?

Try changing these limits to only 2% away (ie. xUp = xRatio>0.98 and xRatio<1.02)

See how this goes
by chooka
Mon Feb 28, 2022 2:36 am
Forum: Pine Script Q&A
Topic: How to make a cumulative line indicator
Replies: 1
Views: 446
 
Jump to post

Re: How to make a cumulative line indicator

Hey there,

Something like this might do the trick?

Code: Select all

//@version=5
indicator("Prev_Day_Close",overlay=false)

prev_day_close = request.security(syminfo.ticker,"1D",close[1])
curr_day_open = request.security(syminfo.ticker,"1D",open[0])

difference = curr_day_open - prev_day_close
plot(difference)
by chooka
Mon Feb 28, 2022 2:30 am
Forum: Pine Script Q&A
Topic: Setting multiple indicators to give alerts
Replies: 5
Views: 1528
 
Jump to post

Re: Setting multiple indicators to give alerts

Hey there, If you can find some examples of code for the Engulfing Candle (note: there's quite a few already on TV). There is also an inbuilt one located here: Indicators -> Technicals -> Candlestick Patterns -> Engulfing - Bullish Then im sure you can get help to put it together with what you have ...
by chooka
Thu Feb 24, 2022 12:12 am
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

Perfect, this is great. I am now working through a series of alert combinations to try to trigger it on the correct HTF bar close. I only want it to trigger when the current HTF candle is closed, not on each LTF confirmed bar within the HTF bar when the signal is true, which is easier said than done...
by chooka
Sat Feb 19, 2022 4:48 pm
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

Hi, it's been running now for 6hrs and not one alert through yet unfortunately, even though I can see divergence has played out on a few tickers.
Note I am using the exact code (copy paste)
by chooka
Sat Feb 19, 2022 11:28 am
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

Hey there, thanks!

I've setup tests overnight and will review the results in the morning!
by chooka
Wed Feb 16, 2022 2:29 am
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

and included below is code for creating this label - so you can copy/paste ;) ////////////// // Debugging label l_dbg = label(na) if barstate.islast label.delete(l_dbg[1]) dbg_txt = "tf1_isNewPeriod: " + str.tostring(tf1_isNewPeriod) + "\ntime: " + str.tostring(time) + "\ntimeframe1: " + str.tostrin...
by chooka
Wed Feb 16, 2022 1:35 am
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

Hi, Thanks for responding! I have tried this code, but I haven't been able to get it to work? It hasn't fired any alerts at all, even when the divergence conditions are true. I set the alerts on 5m chart, exactly as you have listed the code above (note. I tested both with & without the "-(time_close...
by chooka
Sat Feb 12, 2022 4:21 am
Forum: Pine Script Q&A
Topic: Display of Labels & Create Alerts from higher timeframe closes
Replies: 24
Views: 4643
 
Jump to post

Re: Display of Labels & Create Alerts from higher timeframe closes

I couldn't work out how to attach images, so I got some TV screenshots showing this: Alert 30min was fired at 15:05, but you can see the current candle (15:00-15:30) will not be confirmed until 15:30 as a divergence. The transparent labels show that this is a signal that is active, but not confirmed...

Go to advanced search