TradingView
mortdiggiddy
May 22, 2018 4:51 PM

FX Percentage Change 

Euro Fx/U.S. DollarFXCM

Description

See description in script. Use any of the basis currencies to set the zero line. Toggle on/off what to view.

Release Notes

Added documentation, removed "Show labels" boolean box.

Release Notes

Added SPX500, NAS100, US30, US2000USD CFDs (S&P500, Nasdaq 100, Dow Jones, Russell 2000). Removed boolean boxes for selection/deselection of the symbols, use the style header tab instead to toggle (cleaner).
Comments
phinoaf
This is awesome work. Thank you! 2 Questions, how do I un-remove the labels? Also, would you mind if I used this code to make a video? Not the code itself but the results/chart.
mortdiggiddy
@phinoaf, Use the script as you see fit
AgentHK
Hello man, how are you? hope everything is alright. I am interested in programming/developing my scripts and dont know where to start, could you please point me where to start, thank you!
mortdiggiddy
For FOREX traders it is best to use a FOREX chart symbol, like EURUSD, so that the proper interval close bar can be found. You must have a chart interval less than the interval setting of the script. E.G. if you are looking at the daily percentage change (the "Session" box is a "D") then you must be on a chart interval that is less than 1 day in length, or you will just see a bunch of white stars.
mortdiggiddy
@mortdiggiddy, Basis is defaulted as USD. You can set the period to anything, but is default at D for Day.
mortdiggiddy
@mortdiggiddy, You must add this indicator on a symbol, preferable one of the FXCM Currencies so that your close time is 5:00 PM EST. I use a 5 minute chart for daily changes, but other intervals are more appropriate for things like Weekly changes or Yearly changes.
EilderJorgeGarcia
I'm making more or less the same, except I'm using a lot of security function calls instead of using synth calculations for precision... I can't think of anything else to add to your code, Pine script really doesn't allow much creativity... If you want take a look at mine when I'm done and if you find something you like, feel free to use it on your own script...
EilderJorgeGarcia
I did find something you can take off the code, though, the input variables for showEur or showBTC, etc... people can turn these off in the style configuration of the chart, so you don't need to create input variables for them (it doesn't make much of a change, but code ends up a little smaller.)
mortdiggiddy
@EilderJorgeGarcia, Yeah sometimes I just add that as a boolean box for convenience sake, I guess it's more of a code style thing. I try to minimize security calls as it will severely inhibit the load time of the script. You can get away with the time and "newSession" trick to find the close value at the end of the session. The problem with using the security function to find the previous Day's close or previous Week's close or whatever is that the main function (in the examples is FX:EURUSD) close is 17:00 EST. If you use FX_IDC:EURUSD (ICE exchange) this is 18:00.

What I have done in the past to get around this is to add a session argument that describes exactly when the intraday session starts so that you have complete control. This is where you are forced to use the 'newSession' trick in order to find the bar value just before the new session switches over to get the previous close.
khansalarehsan
You are great. Programming!! Nice
More