Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

How to display switch of MAs? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rlouis
Posted : Sunday, November 15, 2009 4:57:04 PM
Registered User
Joined: 11/1/2004
Posts: 47
I want to display two exponential moving averages as follows: display moving average A until a specific date then display average B from that specific date to another date so only one indicator is displayed at any given time.  I am thinking about using non-displayed EMAs indicators as base for custom indicators with user inputs (dates from/to).  How do I control the display of each custom indicator according to the dates?

Robert
jas0501
Posted : Sunday, November 15, 2009 6:21:11 PM
Registered User
Joined: 12/31/2005
Posts: 2,499

one approach is to add both the the chart and not draw them and then use them in real code:

'# MA1 = indicator.MovingAverage.3
'# MA2 = indicator.MovingAverage.4
'# dateOfInterest = userinput.date = 12/08/08

If currentdate >= dateOfInterest Then
 plot = MA1.value
Else
 plot = MA2.value
End If

 

rlouis
Posted : Monday, November 16, 2009 7:43:57 AM
Registered User
Joined: 11/1/2004
Posts: 47
Thanks jas0501. This is what I was looking for. 
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.