[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Increasing the MetaStock(R) Formula Language with MetaStock 7


  • To: <metastock@xxxxxxxxxxxxx>
  • Subject: Re: Increasing the MetaStock(R) Formula Language with MetaStock 7
  • From: "Walter Lake" <wlake@xxxxxxxxx>
  • Date: Fri, 5 Nov 1999 11:41:37 -0800
  • In-reply-to: <8525681E.0052B143.00@xxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Thanks for your email

Yep ... charts are that easy to code in VBA

Once I got the "top stuff" figured out ... I just used the With ... End With
construction to code all of the Chart Properties that I wanted to use. You
just start with a period (.) and list the property that you want to include.
If you don't know what the "names" are for what you want to code ... use
your macro recorder and edit it.

For example to colour the "background" of the chart (PlotArea) I recorded
the following macro

 ActiveChart.PlotArea.Select
    With Selection.Interior
        .ColorIndex = 40
        .Pattern = xlSolid
    End With

This gets edited down to

        .PlotArea.Interior.ColorIndex = 40
        .PlotArea.Interior.Pattern = xlSolid

and included in the code see below. It's really easy and since we are not
intending to become professional programmers we only want to get good at
what we like and use all the time.

Best regards

Walter

=========================

Sub EntryExitPriceChart()

    Charts.Add
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="EntryExitPrice"
    With ActiveChart
        .SetSourceData Source:=Sheets("Data").range("C:C,E:E"),
PlotBy:=xlColumns
        .ChartType = xlLine
        .HasTitle = False
        .SeriesCollection(1).XValues = "=Data!C1"
        .SeriesCollection(1).Name = "=""EntryPrice"""
        .SeriesCollection(2).XValues = "=Data!C1"
        .SeriesCollection(2).Name = "=""ExitPrice"""
        .Legend.Position = xlTop
        .SizeWithWindow = True
        .PlotArea.Interior.ColorIndex = 40
        .PlotArea.Interior.Pattern = xlSolid
        .SeriesCollection(1).Border.Weight = xlMedium
        .SeriesCollection(2).Border.Weight = xlMedium
    End With

End Sub



----- Original Message -----
From: Walter Lake <wlake@xxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Friday, November 05, 1999 7:15 AM
Subject: Re: Increasing the MetaStock(R) Formula Language with MetaStock 7


| Well put Daniel.
|
| Although the learning curve is steep, I've found VBA programming much
easier
| than expected.
|
| There are lots of good books ... many sites are available for help ... and
| there are a group of people in the "MVP Excel" program who are amazing
| programmers that offer free advice. Hooking up with one of them is
| invaluable.
|