Skip to content

Tutorial 87 | Using the Price Series Provider update event

In tutorial 87 I explain how to use a price series provider (PSP) update event. The calculation is very similar to that shown in tutorial 86 (i.e. how to plot an exponential moving average from a 30 minute price series provider on a 5 minute chart)  except this time we recognize the end of the PSP ‘bar’ using the update event.

tutorial 87
Tutorial 87 applied to a 5 minute GBPUSD chart. The result of using the PriceSeriesProvider update event as the calculation made in tutorial 86. Note that the values calculated in real time are shown in yellow.

The biggest challenge with this sort of calculation is that the EasyLanguage indicator is applied to the lower time frame and hence runs on every 5 minute bar, however we actually only want to perform the exponential moving average calculation at the end of each 30 minute bar. Another issue is that the historical plot behaves differently from the real time plot.

The program plots the ‘real time’ exponential average a different color from the historically calculated exponential moving average. I have also plotted the same exponential moving average calculated using data 2 set up as 30 minute GBPUSD bars.

To create a price series provider, I dragged the PriceSeriesProvider from the tool box onto my program workspace. I do some initial setup using the properties tab including, in this case, double clicking the events button followed by the word: ‘Updated.’ I then copy the code from the ‘designer generated code’ and copy it into the program and make some adjustments. I explain this in the video below.

Gold Pass members can copy and paste the tutorial program created in the videos below.

Video explanation | How to calculate an exponential moving average using a price series provider and update event

If you are are a Gold Pass member I have included a copy of this demonstration program below, make sure you are logged in to see the following content:

This content is for members only.

In the video above, the program is applied to symbol GBPUSD.

THESE INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.