Saving default chart configurations
Author: Bionian
Creation Date: 12/7/2009 1:34 PM
profile picture

Bionian

#1
I have created a chart window with the parameters I use most often- MACD,RSI, Stochastic, 20 and 50 day EMA, Upper Bollinger Band, Upper Envelope, and Volume at the bottom. I have also saved this setup as a strategy called "Daily" which I have saved under a folder called "Chart Settings."

Please keep in mind that I am a total novice with C# programming. That having been said, I have also added "PadBars ( 2 );" under the execute line. The problem is, each time I open the strategy, all the indicator panes open at the default size value of 75 "(CreatePane 75, true, true);". I have found that "20" is my preferred setting for indicator panes. This strategy, the way I have saved it, has no entry or exit rules since it is only a group of chart settings. How can I get the indicator panes to display as "(CreatePane 20, true, true);" each time I open this setup. Even better, can I make these settings the default for all WealthLab charts?

I read the instructions on how to save chart settings as defaults by selecting Edit > Save As Default Template Code , but I am not certain what part of the strategy this saves.

Thanks-
Rick
profile picture

Eugene

#2
QUOTE:
How can I get the indicator panes to display as "(CreatePane 20, true, true);" each time I open this setup. Even better, can I make these settings the default for all WealthLab charts?

You can define all the required indicators in a code-based strategy (e.g. below) and save that as Default Template Code:
CODE:
Please log in to see this code.
profile picture

Bionian

#3
Excellent! Your example shows me a great deal about programming for WealthLab. Thanks for your help.
profile picture

Bionian

#4
Eugene-

When I attempted to compile that code, I got the following error messages:

error CS0103 @ (30,27) : The name 'EnvelopeUpper' does not exist in the current context
error CS0103 @ (20,63) : The name 'ChoiceOfMA' does not exist in the curent context

I suppose I should insert a number to show whether I want a simple moving average or an exponential moving average. How would I know what number represents each choice?
profile picture

Eugene

#5
When I read about Upper Envelope in your messagem, the only thing that came to mind was this:

Moving Average Envelope

It's in Community.Indicators but looks like that:

a) by envelope, you mean something else, and
b) Community.Indicators isn't installed on your PC (that's easy to fix by clicking on Extensions > Get Extensions > Indicators).

Question is: what is an "envelope"?
profile picture

Bionian

#6
Eugene-

Post Edited: Thanks for your help. I discovered that I had failed to include the line "using Community.Indicators;"

-Rick
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).