Hi,
I've been using this Pesavento indicator that was generously posted in this forum by Andrew Kirillov: http://www.multicharts.com/discussion/v ... php?t=5017
Among other things, it identifies swings/pivots and draws them on the chart. The code is a bit over my head, but I would like to be able to store these pivot points as variables which can be referenced by a signal. For example, store the last topside swing as vLastHighSwing and the last bottomside swing as vLastLowSwing (see my attached screenshot as an example).
I'm not sure if I can have an indicator script create global variables that can then be referenced by a signal (I have never been able to figure out global variables in Multicharts), or if I need to convert the indicator into a signal. But even more importantly, if someone could tell me where in this code I would need to insert a line that sets the pivot value as a variable (like "vLastHighSwing = <something>") it would be greatly appreciated!
Pesavento indicator (how to convert it into a signal)
Pesavento indicator (how to convert it into a signal)
- Attachments
-
- pesavento.png
- pesavento swings
- (11.12 KiB) Downloaded 580 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Pesavento indicator (how to convert it into a signal)
Before you get too excited... keep in mind one thing: many indicators draw/plot their lines after the fact. When you look at the chart in hindsight, all the duckies seem to lined up perfectly, and easy profits begging for the taking. But in fact they are all too late.Hi,
I've been using this Pesavento indicator that was generously posted in this forum by Andrew Kirillov: http://www.multicharts.com/discussion/v ... php?t=5017
Among other things, it identifies swings/pivots and draws them on the chart. The code is a bit over my head, but I would like to be able to store these pivot points as variables which can be referenced by a signal. For example, store the last topside swing as vLastHighSwing and the last bottomside swing as vLastLowSwing (see my attached screenshot as an example).
I'm not sure if I can have an indicator script create global variables that can then be referenced by a signal (I have never been able to figure out global variables in Multicharts), or if I need to convert the indicator into a signal. But even more importantly, if someone could tell me where in this code I would need to insert a line that sets the pivot value as a variable (like "vLastHighSwing = <something>") it would be greatly appreciated!
In the example you attached, probably the lines were drawn 3 bars after the fact. ie. if you shift the lines 3 bars forward, that would be about the time you got the signal. Which makes the 4th bar the first actionable bar.
Re: Pesavento indicator (how to convert it into a signal)
Thanks for that point, it's good to know! That's fine for my application though, since I just want to use the pivots to know recent highs / recent lows, usually more than 4 bars later.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Pesavento indicator (how to convert it into a signal)
EasyLanguage is a Procedural Language.Hi,
I've been using this Pesavento indicator that was generously posted in this forum by Andrew Kirillov: http://www.multicharts.com/discussion/v ... php?t=5017
...The code is a bit over my head...
::
ie. it executes its instructions in Step-by-Step Procedures. (ie. easy to follow).
I would encourage you to read through the codes... it does take time, but you will find it is NOT that difficult. I am not implying it is easy for a beginner, but with the English-like syntax, it is possible for a non-programmer to understand its logic.
ps. if you are going to use their swings for your trading, you would want to find out how they derive at that swing.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Pesavento indicator (how to convert it into a signal)
Hello jese514,
If you need to share the values between studies – you need to create a function that will do the required calculation and use it in both indicator and signal, or use Global Variables for sharing information between studies.
If you need to share the values between studies – you need to create a function that will do the required calculation and use it in both indicator and signal, or use Global Variables for sharing information between studies.