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 and Starting From The Very Basics, Then Adding In All Customizable Options.
- 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.
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).
#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"....
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?
I am trying to find out how to code as all I want is for my chart to plot horizontal lines, as support and resistance levels, using the already integrated 'Pivots HL' indicator. I was wondering if you would know where to look for me to create this script as its completely foreign to me?!
Thanks in advance
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
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.
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.
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.
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.
it's as simple as x = syminfo dot mintick
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.....
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.
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....
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.
example of chart with alert indicator
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.
The Code is On Page 2
When setting up the Alert
Change the Condition to KAMA RSI Alert_V2
Select Greater Than
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
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
So basically the chart is working but the Alert Server is not.
Thanks again for the help!
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 ?
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?
The Great news is TradingView offers Volume Profile for free to Pro users. Let me know if you have any more questions.
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.
Here's the script I'd like to have custom alerts for:
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.
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.
***Please note. This is a 100% Free Webinar...No strings attached...nothing will be marketed to you.
Here is a link to one I am having trouble with :
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.
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?
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.
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.
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.
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 ?
This one might be easy for you but I am struggling to find the answer.
All I want to know is how to set an alarm if two indicators meet the right standards(?) or set an indicator as the "Rob Rsi Stoch MACD Combo Alert" indicator.
In this case I want the "CM_RSI-2 Strategy Lower Indicator" crossing the 80 or 90 line and the RSI(5) lower than 60,, if that happens an alert would be off or a red(or green) bar would appear the same way as the "Rob Rsi Stoch MACD Combo Alert" as I mentioned.
It must be very simple for you but if your time is not worth it to explain. Could you tell me where to start from please?
Keep your awsome Work ;)