ChrisMoody

New Video Tutorials - Coding Custom Indicators - Ask Questions!

FX:EURJPY   Euro Fx/Japanese Yen
I am currently recording a Video Tutorial Series on PineScript...Creating Custom Indicators.

ASK QUESTIONS BELOW....QUESTIONS WILL BE ANSWERED IN ON-GOING VIDEO SERIES.

Each Video will be 10 Minutes in Length, Covering a Specific Topic.

I will Start By Taking A Common Indicator Like the MACD and Starting From The Very Basics, Then Adding In All Customizable Options.

Topics Include:
- The Basics You Need To Know.
- Available Reference Materials.
- Creating Custom Colors Based On Conditions.
- Changing Bar Colors Based On Conditions.
- Using Multi-TimeFrames.
- And More...

We Will Have Guest Appearances From Some Of The Top Coders On TradingView Showing Advanced Techniques!!!

We Will Also Cover Other Types Of Indicators!!!

ASK QUESTIONS BELOW...ANYTHING REGARDING CODING IN PINESCRIPT.

QUESTIONS WILL BE ANSWERED IN VIDEO SERIES.
Thanks Chris. You have some great scripts written, been using some and love your work. Thanks for that! :)

I have an idea and need some help writing a script of my own as below:
1. It will be an overlay=true script so I get it on top.
2. Will need 6 input float values (max 9) for each ticker symbol and there will be 5 or 6 ticker symbols. Not sure if we can get multiple input values for each ticker in pine??
3. I also need a date field in input, which should be checked in the pine script. If current date is equal to the input date field, only then draw the steps 4 thru 6 below.
4. Draw horizontal lines (with different colors and styles) for each symbol based on 6 (or 9) different float values for current day only from 8 AM ET to 8 PM ET. Line should span from 8 to 8 for that day. For different line styles and color I am looking to provide these as input values as well for each float value for the ticker symbol.
5. Looking to provide a clear button in the script so I am able to clear the drawing for that script from yesterday or before. But if I chose not to clear then the drawing can stay for those days and new plot will be for today if input date value matches system date.
6. The above lines for each ticker symbol should be drawn on respective underlying ticker chart only.

I hope I was clear on what I was looking to do.

Thanks in advance and look forward to writing this (if possible in pine).

Navin
+1 Reply
#1 - Very Clear.....
#2 isn't clear. Do you want to plot 6 Symbols or 6 Indicators each based individually on 6 different symbols?
#3 - Pretty clear...or It's clear but based on all the other requests I don't understand.
#4 Draw horizontal lines with different colors and styles....This is built in to EVERY code in the styles tab...You always have that control.
#4.1 When you say 6 or 9 different float values....No Idea What You Mean?
#4.2 From 8-8pm...That is no problem
5. Look...I'm a feature based FREAK you could say..I want it all. I own or have used about every platform around. The ability to say plot values only for today..or historically will come some day...we will have that. But a check box where the script understands to keep leaving plots and if you check a box it goes back to todays values??? I haven't seen it....and if the capability was there it would require a good programmer and your talking over $1000+ to code something like that.
6. To me that is not clear...I have no idea what you mean...respective underlying ticker chart only is definitely throwing me off...I may understand the first part depending on what the 2nd half of the sentence means.

One Question...Is this a 'Dream" Indicator for you...or do you have a screenshot of a platform it is currently working on....If so "A Picture Is Worth 1000 Words"....
Reply
abnavin PRO ChrisMoody
Thanks Chris for your response. I will enclose an image of what I have on TOS chart. Please see on the extreme right horizontal lines for each price line with price labels. I am trying to build these daily zones for myself.

Example 1 (A-A-P-L): http://gyazo.com/d21f69a100099c7c297b48311f3e7eff

Example 1 (NFLX): http://gyazo.com/f224d948287a8080319ff24b33089d0a

6. To answer question 6, these horizontal lines should be drawn for the prices (on right as in the sample above) say for A-A-P-L only when the selected symbol is A-A-P-L for the chart. If I select NFLX chart, then lines for NFLX prices should be drawn and A-A-P-L price lines should not reflect on that chart (2nd image).

Does this make sense?
Reply
send me a PM and I'll give you my email...send me that indicator...I understand there code...and I'll let you know what can be done
Reply
HI CHRIS:HAVE YOU EVER WRITTEN A SCRIPT ON HOW TO SCAN FOR STOCKS. LIKE THE BEST OF THE BEST. THANKS CHUCK
+1 Reply
Yes..But that requires Scanning Feature/Capability. This feature will be implemented by TradingView in the not too distant future. Although I don't know of a specific date yet..
Reply
ChuckK ChrisMoody
I WOULD BE INTERESTED. THANKS CHUCK
+1 Reply
Please explain how to code plot visual shapes for custom indicators (https://www.tradingview.com/study-script-reference/#fun_plotshape) and also the location value for plotshape https://www.tradingview.com/study-script-reference/#var_location{dot}absolute.
+1 Reply
N problem...Easy once you see it...It will be in video series But I'll find a Indicator I posted that uses it so you can see...you'll pick it up quick.

Only current issue is you can't control the size of any of the plot shapes except the Arrows one....
Reply
ChrisMoody PRO ChrisMoody
This one has the plotchar feature ...
Opening Range Breakout with 2 Profit Targets.

+1 Reply
ChartArt ChrisMoody
Thank you.

"Only current issue is you can't control the size of any of the plot shapes except the Arrows one....

I guess I'll go with the arrow then :)
Reply
ChrisMoody PRO ChrisMoody
This one shows a few different plot locations of the plotshape...and how you name it and set the location....the only one that is tricky is the location.absolute...have a code with it somewhere...but it was never published so I'll have to find it
Reply
ChrisMoody PRO ChrisMoody
forgot to give link to the code mentioned above
CM_Gann_Swing_HighLow

+1 Reply
ChartArt ChrisMoody
Good example with lots of different shape locations, thanks.
Reply
I would love to see an explanation how to build a switch that a custom indicator uses either close or Heiken Ashi bar values:

https://www.tradingview.com/study-script-reference/#fun_heikenashi
+1 Reply
First time I looked at it....but it appears easy to do.,..Another one just made the video series
Reply
I would be interested to learn what the "current bar time" does and what kind of custom indicators this enables:

https://www.tradingview.com/study-script-reference/#fun_time
+1 Reply
ChartArt ChartArt
And is there an idea how to add the "barssince" function to this "current bar time" in a custom indicator? What are some creative coding ideas using both in combination?

https://www.tradingview.com/study-script-reference/#fun_barssince
+1 Reply
ChartArt ChartArt
Or could be a good combination to use the "valuewhen" function with time or "barssince"?

https://www.tradingview.com/study-script-reference/#fun_valuewhen
+1 Reply
First...I owe you one...I've been asking for the barssince function for a long time...it has powerful features you will be surprised when you see codes use this.

However, (We're seeing a them here...since Strategies are coming)...you will use it all the time in Strategies. If BarsSince Entry (Say 5) is Greater than entry Price Then....Close Trade...Take 50% and Bring Stop to Break Even etc. You will use this code ALl the time...also with conditions. Example I just wrote a script ... If condition 1 is True...and Condition 2 happens within 10 bars..then enter Trade....Else no trade. (If condition 1 = true and BarsSince Condition 1 is less than or equal to 10 AND Condition 2 is TRUE then Enter TRade) So if it happened on bar 11 then no trade...

below is a code of the example they used. BarsSince Close is greater or equal to open...So Basically it is a Counter from a defined condition.

Thanks ChartArt...now I will be up all night coding stuff I've been wanting to forever

snapshot
+1 Reply
ChartArt ChrisMoody
"now I will be up all night coding stuff I've been wanting to forever "

ha ha :) go ahead :D I will also dip a toe into this the coming weekend
Reply
"And is there an idea how to add the "barssince" function to this "current bar time" in a custom indicator? What are some creative coding ideas using both in combination? "

You'll find it's more useful when you want to know answers like how many bars since this condition happened does the trade work...you'll find valuable info there. A lot of my strategies have exit one third after X bars ....this uses barsSince Entry. Using it with time would work but you already know the answer. "If I'm looking at a 60 minute chart how many BarsSince Midnight...well if it's 10 am then answer = 10.

Useful Example.
Opening Range Breakout - say we are using a 60 minute time to break out from using a 5 minute chart. We define the session start time to start at 9:30 am....so opening range lasts til 10:30 am. If BarsSince OpeningRange Start Time is greater than 12 and Close is Greater than Opening Range High, Then Enter Long 3 Contracts...etc...

So even though it's time based your typically defining a condition and using that condition.
+1 Reply
ChartArt ChrisMoody
Ok, so another function which is more useful for strategy testing than classic indicators.
Reply
First time I've used it but by default both examples use True/False Values using the 0 for false and 1 for true. Like I showed how to do in alerts video. I'll explain uses after I post 2nd version. This shows a True value when Apple 1 minute chart...Time is 1300 to 1400 ...

snapshot
Reply
ChrisMoody PRO ChrisMoody
This chart shows the same indicator showing when time is between 1300 and 1400. This time the yellow Indicator below is showing a True Value every 10 minutes.

The first example could probably work for Highlight bars during certain times of day....Background highlights, or Alerts

I see two main uses for the second one (lower yellow)...#1...If you were trading lets say a 60 minute, 5 minute, 4 hour chart..whatever timeframe if you intraday trade. You could set an alert when the bar is closing so you know you need to go check you system of whatever signals it might provide. You could also use it for creating a highlight bar...example...your looking at a 60 minute chart of forex...you could have a Plot on every 4th bar to remind you the 4 hour bar just closed...etc.

snapshot
+1 Reply
ChartArt ChrisMoody
"You could also use it for creating a highlight bar....you could have a Plot on every 4th bar to remind you the 4 hour bar just closed...etc. "

Yes, I think this might be the best use for this function. Maybe in addition with a plotshape and the If Then Else:

If the 4 hour closes above the last 4 hour draw a green number 4 on top of the 4 hour close, else draw a red number 4 on top of the 4 hour close.
Reply
dimension4 ChrisMoody
Hi Would you be willing to post the code for this?
Reply
What is the purpose of the arc cosine of a value? And what can you do with it in terms of custom indicators?

https://www.tradingview.com/study-script-reference/#fun_acos
+1 Reply
ChartArt ChartArt
... also the arc sine of a value and the arc tangent of a value

https://www.tradingview.com/study-script-reference/#fun_asin
https://www.tradingview.com/study-script-reference/#fun_atan
+1 Reply
Never used it...I will look in to it
Reply
What is the difference between the "iff" and the "?" and when to apply which one?

https://www.tradingview.com/study-script-reference/#fun_iff
https://www.tradingview.com/study-script-reference/#op_{question}{colon}
+1 Reply
I'll go in to detail on this in videos...very simple...

In the coding world they both mean the exact same thing. IFF this condition THEN whatever condition we choose ESLE this condition...Or NA for Nothing.

Iff Then Else...
Reply
ChartArt ChrisMoody
Thanks for explaining this.
Reply
Please explain the "syminfo.mintick" and the "syminfo.pointvalue" variables:

https://www.tradingview.com/study-script-reference/#var_syminfo{dot}mintick
https://www.tradingview.com/study-script-reference/#var_syminfo{dot}pointvalue
+1 Reply
On the chart below shows one way of using them.

it's as simple as x = syminfo dot mintick
plot x

gives the mimimum price movement a symbol can have...this is mainly used for Futures which move in different values. The chart below is of the es (S&P E-Minis), the symbol moves in .25 price movements...so 4 ticks = 1 point move.

Then the pointvalue - The amount the contract is worth for each FULL Point Move. On the lower indicator you will see 50. So if a symbol moves in .25 Point Price Movements (We found this out on first indicator) so if 4 ticks equal a point... and a point = $50 (Always per 1 unit or 1 contract in futures) Therefore Each Tick = $12.50 in Value.

On Chart below:
Top Indicator (yellow) says min Tick Value = .25
2nd Indicator (Aqua) says point value = $50
3rd Indicator (Green) is a basic custom calculation I did that tells us 4 Ticks = 1 Point
4th Indicator ( Orange) Tells us the Value of each Tick Move.

My guess is this will become VERY Valuable in Strategies if you want to take profit at lets say after $500....Well this is a way you can tell the computer how to pull the values.

Should work of forex also.....

snapshot
+1 Reply
ChartArt ChrisMoody
This is a really great explanation of these two variables. Thank your very much!

Reply
Hi Chris,
I was wondering if it is possible to check for 3 conditions on separate indicators, and only when all 3 conditions are true, to activate an alert by sending a text to my phone. The conditions would be RSI crossing a certain level, the TSI fast crossing the TSI slow, and the CCI crossing a certain level. If all 3 conditions could be combined into one indicator that would be the best, but I don't know how to do that. Thanks for all your great indicators you have produced by the way.

+1 Reply
ChartArt SurfDude
This is a really good question and I wanted to check for multiple conditions as well. My solution was that I discovered two months ago the code made by HPotter:

"This is an example to show you how you can combine two and more strategies to get
a cumulative signal."

MultiTradingSystem
Reply
Easy....will put in videos...
Reply
ChrisMoody PRO ChrisMoody
In regards to the link above...
yes...HPotter is a talented coder.
There is a simpler way...if your setting code up for Alerts...with Alerts being the end result you want.....In the code above on alert value would be 1 and one alert value would be -1...this works fine...but if your goal is to set an alert you want to create True conditions or values of 1...

Take a look at this script....
CM_Williams_Vix_Fix_V3_Ultimate_Filtered_Alerts

it looks complex but just go down to the -- Alert Criteria area.
You'll see 4 true false statements. 1 = True, 0 = false.
Then you can see plots at bottom with Alerts in the title so very easy to find in Alerts panel.

I've done what your asking many times just can't think of a script off my head that I published.

But I will show in video...we may even use yours as an example.
Reply
Hey Chris. Thanks so much for all you do! I have learned so much from you. Both programming and trading! I'm having a problem with programming an alert on an indicator. I've watched the video twice and I think I programmed it right. It seems to plot correctly but I can't get the Alert to fire off. This is my first attempt at writing a script so I'm sure it is something in the way I coded it. When I'm setting up the alert I don't get the option to select the variable "alertline" just the name of the study. If I set the parameter to greater than .9 it doesn't fire but if I set it to less than .9 it fires immediately. So it seems to be on the reaching the server. Basically the indicator determines whether KAMA has crossed over or under a MA and then determines if a Lineal Regression of an RSI is moving up though or down through a target line. Also while I have your attention :-) is there a way to program it so it just alerts on the first instance after KAMA crosses not subsequent instances until the next cross?
example of chart with alert indicator
KAMA MA Cross with RSI Alert

text of source code https://docs.google.com/document/d/1RnukMl_KjxdixEjSQfgSUnIq6jbiK_A2HxjyAzhJg80/edit?usp=sharing

Thanks again really enjoy all your stuff. It is so helpful.
Reply
ChrisMoody PRO sandpipertrader
I verified it works perfectly...I changed the order of the code and labeld it _V2.
The Code is On Page 2
https://docs.google.com/document/d/166eAecT5wBwHnGVQPbDjxJY_v_KY6gpe_quiGn_4w-I/edit?usp=sharing

When setting up the Alert
Change the Condition to KAMA RSI Alert_V2
Select Greater Than
Select Value
To the right of Value put .99
For Frequency choose Once Per Bar on Close---Or Condition.

For your last question...they just released several new functions...I'll play around with them...if not there are a few things we can do...not perfect solution...
Remind me in a couple of days and i'll write it for you to show you an example
Reply
ChrisMoody PRO ChrisMoody
I put on multiple symbols on 1 minute bars and the alerts worked perfectly. The reason if you use less than .9 or .99 that it fires immediately is 99% of the time the value is Zero.
Reply
ChrisMoody PRO ChrisMoody
I plotted your upper and lower indicator...and if you have them on the chart this is what it should look like with alert active.

snapshot
+1 Reply
ChrisMoody PRO ChrisMoody
Ah...for some reason id doesn't plot the Alert Lines on the Screenshot.
Reply
Thanks so much! I'll give your version and settings a try . I"ll let you know how it goes. Also thanks for directing me to Chris Capre and 2nd Skies.
Reply
sandpipertrader sandpipertrader
Still getting some funkiness about when the alert fires and I get the SMS. Documenting it and taking a bunch of snapshots and will let you know.

One question I have on general coding... what is the meaning of empty closed parenthesis? For example on your pin bar code pBarUp() => spb and open > high - (range * pctCPO) and close > high - (range * pctCPO) and low <= lowest(pblb) ? 1 : 0
Reply
sandpipertrader sandpipertrader
It plots perfectly but I seem to be getting the alerts when the opposite is happening, For example on the chart above, using the first two signals, it plots correctly and the indicator = 1 but I don't get an Alert sent. Then the next time the Lineal Regressions crosses back down through the 72 signal line (not a valid signal) I get an alert even though the indicator value is 0. I am running it right now on 10 different charts and will sent you some pics after a few instances.
Reply
sandpipertrader sandpipertrader
Ok here is the link to some examples. As you can see, the chart plots the alert correctly but an alert is never sent, then when the indicator is plotting 0 (which is correct ) and the RSI crosses with a false signal (still generates a 0 which is correct) the alert fires and I get the SMS.
So basically the chart is working but the Alert Server is not.

https://drive.google.com/folderview?id=0B4I_skH7AKC5QmJJSUZSbno5LTA&usp=sharing

Thanks again for the help!
Reply
sandpipertrader sandpipertrader
This morning (without any changes) I started getting some Alerts on some of the pairs at the right time and place (when the indicator was at 1). Others were still firing off at the wrong time (when indicator was at 0 and opposite crossover was happening). I'm thinking it must be something on the Alert server. Even on the main chart when I set for a simple MA KAMA cross the alert won't fire. I don't think the server likes KAMA.
https://drive.google.com/file/d/0B4I_skH7AKC5Z1dZSGtUdm5Wbjg/view?usp=sharing
Reply
Chris, Let me put this in public, If there is one person i have to thank in the market. It would be you, Who helped me tackle this trading mindset issues. Thanks for all your patience and advice, I know i bugged you with questions, like how you keep yourself focus on a strategy, even after taking some huge loss. We spent hours on phone, possibly will in future. To keep it simple, you are a good trader and a good person. Thanks again.
Reply
can you script a fib indicator? there is one by someone but it is too crowded and I cant see the charts.
Thank you
Reply
questions for the video series ...

report writing :
file io and printing:

i would like to create a spreadsheet type of report
for multple tickers.
the first column in the report lists the tickers, ibm, s, c , .... etc.
and the other columns are indicators like rsi(14) , macd ..... etc.

selecting the indicator would display the report either to the screen or to a file.

the tickers list could be hard coded in the script or could be loaded from a table,
so i might have a set of tickers for the sp500 , in a file, which i could reference.

how do i print this report to the screen, and how do i print it to a file

is there any other way that you you write a report in this format in addition to
using the indicator script method ?

Reply
Hi Chris,
I've looked around the resources on TV but can't find an example that shows how to plot a line forward into the future. Typically, I'd like to do this with pivot-type lines. Let's say the markets have just opened and my indicator has worked out the projected pivot-type lines for the day. As of now, the lines get plotted as each bar is being formed - would be so much nicer if we could have the lines projected forward (beyond the current bar) extending all the way till the end of the market's normal time. Is this currently possible with PineScript?
+1 Reply
Hi Chris , excellent PA indicator. Is it possible to add a shape (cross, circle or any other shapes) at 50% of the total Pin Bar ragne (hi-lo) and draw the trackprice line? This is when we select to have the indicator to locate the pin bar.
Reply
faizal.mansor.908 faizal.mansor.908
*range
Reply
Hi. I would like an indicator which would show YTD Percent change. Actually it could have Input for any starting date and any ending date. I would like for it to begin the YTD on Close 31st Dec, 2014, and ending date to be whatever the current date might be.
Thank you,
Bill
Reply
Hey Guys... Sorry for the delayed response…I just got back…

Thanks for all the GREAT questions and requests....

I'll be recording a TON of videos over the next 2 weeks...and I'll launch a live Webinar Series for those who are interested...
+2 Reply
Oh yes please now that i have found going to be difficult to shake off!!
Reply
jojo9361 ChrisMoody
Hi Chris,

I am definitely interested, in learning how to code indicators on Trading view. I am new to the platform but have done some simple coding in the past.

Thanks,
John.
Reply
Hello Chris, thank you so much for you fantastic indicators and your great videos. I have tried coding an alert for your indicator "Modified Heiken Ashi Trendbars". I follow everything on the video you posted and it seems to work fine at first because I see the oscillator at the bottom, and it's in accordance with the indicator. Every time a candle turns green, the oscillator goes to 1, and then to 0 when it turns red. The problem is that when I set the alert, it just does not work! Mostly, the alert will pop a couple minutes after setting it, but the color of the heiken did not change, and the oscillator is still in the same place. Can you help me out ? It would be greatly appreciated. All I need is to have an alert on those heiken trendbars for color change ! Thanks in advance Chris.
Reply
Glad to hear about the new Pinescript videos. One area I would like to see addressed is coding with decimals.
I have tried to code MACD wtih decimals in the parameters with no success. Thanks Chris.
Reply
Hi Chris, Your work is really nothing less then spectacular.
Now I would like to advise to add alert capabilities to the CM Gann Swing.
Reply
Is it possible to code an indicator for market profile (TPO)?
Reply
ChrisMoody PRO rmwaddelljr
Market Profile(TPO)...We're talking about the letters for each time period Right?...No...Reason is this is licensed to the CBOT...other way to say this is they own the rights so you have to pay them monthly to use it. HOWEVER...Volume Profile is more accurate. I know they guy that trained the CBOT Floor traders on how to use Market Profile. Over the years he discovered that Volume Profile or Volume at price was much more accurate. I can go in t many reasons why.

The Great news is TradingView offers Volume Profile for free to Pro users. Let me know if you have any more questions.
Reply
IvanLabrie PRO ChrisMoody
Only problem is trading FX you don't see reported volume, so you're stuck with the time spent at price.
I do a similar thing, by hand, tracking the time spent at price in a bar chart (Tim West's time at mode).
Works like a charm.
Reply
ChrisMoody PRO IvanLabrie
True...FX doesn't provide true volume at price like the futures market does. to calculate this FX most data providers don't use time at price..they use each tick (meaning every time price changes in fractional pips they total those up as volume.

But here is a little secret most people don't know about. If your a Pro Subscriber and you type in a FX symbol like EURUSD the 2nd choice in the dropdown menu will be forex idc. idc is a professional data feed that uses the Tick calculation to calculate volume...so any Volume based indicator will work. I've found it Very Accurate in relation to futures.

The chart below as the EURUSD idc feed with volume at price. The lower pane is the Euro Futures over the same period...you'll notice the Volume profiles look almost identical.

snapshot
Reply
ChrisMoody PRO ChrisMoody
Changed it to a daily chart using Fixed Length Profile from the same days...They look Pretty identical to me.

snapshot
Reply
rmwaddelljr ChrisMoody
Thanks Chris. It's available to Pro Plus users. I agree with your assessment about volume profile.
Reply
ChrisMoody PRO rmwaddelljr
Thanks for the Pro Plus clarification...I should know that...but I didn't. I'd like to do a basic webinar series on volume profile. I may do a post next week and see if enough people are interested.
+1 Reply
rmwaddelljr ChrisMoody
I would be interested. I continually find that this community is a treasure of ideas and information. Thanks for your contribution!
+1 Reply
rmwaddelljr ChrisMoody
Would this be easy to code? http://stockcharts.com/school/doku.php?st=volume+by+price&id=chart_school:technical_indicators:volume_by_price
Reply
Vince PRO ChrisMoody
Hi Chris- I would wonder also if easy, I have been teaching stock seminars for 20 years and even so I am not linear Left Brained and most coding looks to be from that area. I would be concerned it would be complex and I think my coding is simple suggestions visually anyway what it looks like in code is maybe different. I however would like to know if can be made easy ?
Reply
Chris,
Is there a code that can be put in a custom indicator to plot arrows or visual symbols on the chart for built in alerts?, i create an alert that beeps when the candle crosses a bband, can that be visual as well actually on the chart where it happened?
Reply
jojo9361 binaryking
Hi Chris,

Once again thanks for the very informative information and scripts, could I see the video for coding a basic indicator, I have some experience of coding but not on this platform, it would be good to have a go at creating some here.

Many Thanks,
John.
Reply
Sorry it's been a while...see my post at the bottom of the page regarding the webinars I'll be hosting
Reply
ChrisMoody PRO binaryking
Yes...see my post at the bottom of the page regarding the webinars I'll be hosting...I'll try to cover on these first two webinars for you. I will absolutely be covering using all Plot ptypes on the coding webinar series
+1 Reply
ChrisMoody PRO ChrisMoody
The comment above was for BinaryKing
Reply
Hello :) I just finished watching your video on creating custom alerts, but it was a little over my head and I'd sure appreciate your help.

Here's the script I'd like to have custom alerts for:

study(title="Acceleration/Deceleration", shorttitle="AC")
ao = sma(hl2,5) - sma(hl2,34)
ac = ao - sma(ao,5)
plot(ac, color = change(ac) <= 0 ? red : green, style=histogram)

I would like an alert on the first green bar of the histogram, and another on the first red bar. Is that possible?

Any assistance would be greatly appreciated.


Thanks!
Reply
ChrisMoody PRO BryceHenderson
Bryce...see my post below...and I'll feature this as one of the scripts on the webinar.
Reply
where can i find the videos?
Reply
See my comment below
Reply
guywest ChrisMoody
Hi Chris. Thanks for all your excellent work! I too was looking for the video link in your comment below but did not find it? I'd like to watch the first part about how to create custom alerts. Thanks.
Reply
Hey guys...To start this off I'm doing a 2 part webinar series on "How To Create Alerts on Custom Indicators". The first session is Tuesday, August 11th at 4:30 pm Eastern. The 2nd webinar date and time will be announced during the 1st webinar session. I will take a poll and let you guys pick the best day of the week and time that works for you.

Webinar #1 will cover 2 main topics.

Topic 1 - Utilizing the Alerts Panel Properly:
1. The improvements TradingView has incorporated giving you the ability to create alerts with custom indicators.
2. How to use the "Alerts Panel" to find the correct Plot Statements to use in order to create the alerts you want.

Topic 2 - If Topic 1 doesn't work - How To Make Changes In The Code:
1. How to find the condition in the code you want the Alert to trigger on.
2. How to create a True/False condition to get the Alert to trigger according to your goals.
3. How to set up the Alert properly in the "Alerts Panel".

Webinar #2 is for those who really want to learn. After taking the information presented in the 1st webinar, if you try your best to customize your indicator, I will stay as long as it takes to help each and ever one of you with your code. After everyone's indicators are working properly I will take questions on any topic you want to discuss.

***Shortly after I will announce a weekly webinar series on coding. Where we will cover each of the topics listed in the description at the top of the page.

You can register for the 1st session via the link below.
https://attendee.gotowebinar.com/register/7221366240123560962

***Please note. This is a 100% Free Webinar...No strings attached...nothing will be marketed to you.
Reply
ChrisMoody PRO ChrisMoody
By the way....if you have a certain code your having trouble getting alerts set on place a link to it below....if it's not in the PineScript Library please provide a description of what your trying to accomplish.
+1 Reply
littleriver ChrisMoody
Hi Chris

Here is a link to one I am having trouble with :

Bill Williams. Awesome Oscillator (AO) Signal Line


I am wanting to get an alert on this indicator when the value changes direction. I can set an alert for a specific value crossing but this not what i want. I do not want this because several candles may pass before the alert is triggered and the true turning point is missed. Maybe it could be triggered by a change in color of the histogram? Or triggered by a change in value direction? For example : if the value is falling, it could be set to trigger when the value rises.

Thanks
Vic
Reply
ChrisMoody PRO littleriver
Thanks
Reply
littleriver ChrisMoody
Hi Chris

Completed the custom alert on the custom indicator the way you demonstrated at the webinar. Happy to report complete success. Alerting exactly the way I wanted. Thank you !! Very happy trader........
Reply
schoolex ChrisMoody
will there be a replay if we cannot make it for the seminar?
Reply
It will be emailed to those who are registered.
+1 Reply
Thanks for all your help
+1 Reply
skysan45 PRO ChrisMoody
If we are late to register will we be able to get the link to watch the presentation when we can?
Reply
How to write script for a look back period as range i.e past 4-20 bars?
Reply
Hi Chris would you be willing to post the code where you have turned a logical 1/0 value for the AAPL chart during the time of day 1300-1400 the value goes to 1 otherwise it is zero?
Reply
Hello Chris, Hope you don't mind the resurrection of this thread with a question. I was wondering if you know how to check for the actual tick size in pinescript, like 60 when in 1H and 5 when in 5m. I would like to configure some scripts with different default values depending on the timeframe. Thanks!
Reply
How to add take profit and stop loss on the pine editor?
+3 Reply
Hello Chris, Hope not bothering here, I really need help on building an alert that takes three or 4 indicators and triggers and alert when all the indicators agree...is this possible in TV??
Reply
Hi Chris, where can I get your videos on how to code custom indicators, I am after combining different indicators to create a system. Thanks.
Reply
korukele84 PRO korukele84
I am looking to do the same as JDSarano ^^^.
Reply
Does tradingview have a alert for volume indicators?
Reply
Hi ! where can I find the videos- thank you!
Reply
Hi Chris, Thanks in advance for providing great information and answers. I am very new to coding and having trouble defining the entry price of my strategy, in order to place stops 10 pips below entry and targets 10 pips above entry. Any help with this matter will be very appreciated. Thanks again
Reply
Does trading view have the ability to show tick count??
Reply
I'm a Software Engineer but completely new to the Pine language. I'm working a lot with SHS or iSHS (I call them fractals) to find a possible target in all time frames. I'm planning to make a program to calculate the target values. With (i)SHS I mean all variants, so also the types with sloping necklines. What I have in mind is to draw the neckline with a special color (variable in program) and after activation of the program it should draw a horizontal line with a special color (another variable) on the calculated target and put the calculated target number unther or above the neckline depending on inverted SHS or not (see picture). The first challenge for the script is to find the values of the points where a bar is connected with the manual drawed neckline (in the picture the neckline is drawed too long to the left to calculate an accurate result).

Are there experienced programmers here who can give me a fast start-up how to do this?

Are there some basics already present I can use to do this?
Reply
watchme3 watchme3
Sorry. Did apparently not succeed adding a picture
Reply
watchme3 watchme3
new attempt to insert picture
Reply
Do you have any tips on how to determine if a strategy script "cheats" by repainting?
+1 Reply
Hey Chris - all great stuff.

I wonder if you know how to create custom indicators for strategies, as you can't pull them in in the same way you can for Study() scripts even if you plot them as boolean indicators on overlays.

The real problem I have is that the strategy position indicators are one bar old and don't get rendered until the next bar, so custom alerts of some form seem necessary. Also in my case, I want "take profits" signals which requires position sizing calculations from the strategy itself so can't just create a separate study() for the underlying indicators.

Also, whilst I'm bothering you... do you know if it's possible to pull in data series from external indicators you don't have the source code for? I saw your post ages ago on the lunar cycles and thought it would be fun to see how that affected my back testing, but I'm not especially keen to manually code in lunar cycle dates back to the year 2000 so want to pivot off the built-in MP indicator in my strategy.

Cheers,

N
Reply
Need help creating pine script to indicate 1atr value below and 3 atr value above price entry .

can you help me create a pine script that shows a line at 1 atr value below my price entry# and 3 atr value above the same price entry#.

for example: i want to buy a stock at 1.00, the atr value at 1.00 is 0.20. there for i would like an indicator to draw a line at 0.80 and 1.60.

Thank you
Reply
Hi Chris, not sure if this thread is still being used, but thought I would ask anyway as you seem to be 'the man'. I am having difficulty creating alerts. When my criteria is met, I plot a BUY arrow, and want an alert to occur at the point of the arrow being displayed. I am able to add the alert and condition to some of the currency pairs, but not on some others, because my script does not appear in the 'condition' list of the alert creation screen. My code for the alert is :

alertcondition(Trend == 1 and Trend == -1, "BUY", "BUY")
plotarrow(Trend == 1 and Trend == -1? Trend : na, title="Up Entry Arrow", colorup=green, maxheight=1000, minheight=50, transp=40)
alertcondition(Trend == -1 and Trend == 1, "SELL", "SELL")
plotarrow(Trend == -1 and Trend == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=1000, minheight=50, transp=40)

Any help very much appreciated.
Reply
I am new to pinescript and am trying to figure out a simple strategy/alert that would signal an alert if the weekly %k stoch was greater than the previous weeks close AND the daily %K stoch is greater than the previous days close. Is this doable? Thanks
Reply
Hi Chris

Your posts have been a great source of help for me to develop something of my own using Pine Script. There is one query I have for you. I want to show pivot - support - resistance lines in my custom code only for the current day / session or from a certain number of days before the current day. Standard Pivot Point code in TV library has this feature. But am unable to find a function or set of functions that will enable me to do this. Would be grateful if you can let me know how to do this ?

Syam
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out