ChartPane Object

The ChartPane object represents one of the panes of the current chart.

BuyAtMarket

ConvertValueToY

int ConvertValueToY(double value);

Converts the specified numeric value to the Y-pixel coordinate on the chart pane.  This method is most valuable in custom Chart Style programming, but can also come in handy when developing custom Drawing Objects or using WealthScript's PaintHook functionality.

BuyAtMarket

Decimals Property

int Decimals

Specifies the number of decimals places that will be used to format values in the chart pane's margins.

Remarks

BuyAtMarket

DisplayGrid Property

bool DisplayGrid

Determines whether the horizontal gridlines should be visible on this chart pane.

BuyAtMarket

FormatChartValue

string FormatChartValue(double value);

Formats the specified numeric value to an abbreviated string, based on its value, and also taking into account the Decimals property.

Examples:

123.45 will format as 123.45
12,345 will format as 12.34K
1,234,567 will format as 1.23M

BuyAtMarket

GetBackgroundColor

Color GetBackgroundColor(int bar);

Returns the background color at the specified bar in the pane.

BuyAtMarket

Height Property

int Height

The current height of the pane, in pixels.  This property has limited value at the time a Strategy executes, but can prove valuable when building custom ChartStyles, or using the PaintHook functionality of WealthScript.

BuyAtMarket

IsPricePane Property

bool IsPricePane

Returns true if this chart pane is the one that the main price bars are being plotted on.  This property has limited value in Strategy code, but can prove useful in programming custom Drawing Objects.


Example

protected override void Execute(){
if ( PricePane.IsPricePane )
        System.Windows.Forms.MessageBox.Show( "Operating in Strategy window" ); else
        System.Windows.Forms.MessageBox.Show( "Running in Strategy Monitor" );
}
BuyAtMarket

LogScale Property

bool LogScale

Controls whether the chart pane will be plotted in semi-log scale.

A semi-log scale gives equal weight to percentage changes, rather then absolute value changes. For example, the distance from 1 to 10 will be the same size on the chart as the distance from 10 to 100. It's called "semi-log" because only the y-axis uses the log scale, whereas the x-axis [typically] remains evenly-spaced.


Example

protected override void Execute(){
    if( ( PricePane != null ) & ( VolumePane != null ) )
    {
        
        PricePane.LogScale = true;
        VolumePane.LogScale = true;
    
        DrawLabel( PricePane, "Price Pane is in Semi-Log Scale? " + PricePane.LogScale );
        DrawLabel( PricePane, "Volume Pane is in Semi-Log Scale? " + VolumePane.LogScale );
    }
}
BuyAtMarket

SetBackgroundColor

void SetBackgroundColor(int bar, Color color);

Sets the background color at the specified bar in the pane to the specified color.

BuyAtMarket

Top Property

int Top

Returns the location of the top of the pane from the top of the chart, in pixels.  This property has no real value in Strategy code, but can be useful in custom Drawing Object development, or implementing PaintHooks in the WealthScript.