Download Vitamin-C User Guide

Transcript
Vitamin-C for Metastock
Version 1.0.1
Contents
CONTENTS .......................................................................................................................... 2
DISCLAIMER ....................................................................................................................... 6
COPYRIGHT AND LICENSING AGREEMENT ....................................................................... 7
Trademarks .............................................................................................................................. 8
ACKNOWLEDGEMENTS ....................................................................................................... 9
VITAMIN-C FEATURE SUMMARY .................................................................................... 10
INTRODUCTION ................................................................................................................. 12
The problem............................................................................................................................ 13
Why the MetaStock Formula Language has limitations. ............................................................ 13
Trying to code simple systems using the MSFL ........................................................................... 15
How MetaStock Communicates with Vitamin-C ................................................................ 16
Calling script files from your MetaStock code ............................................................................. 16
Anatomy of a Vitamin-C function call.................................................................................................. 16
Example of using CallScript with No User Array Arguments .......................................................................18
Examples of using CallScript with 1 User Array Arguments ........................................................................18
Example of using CallScript with 3 User Array Arguments..........................................................................18
Your First Step ....................................................................................................................... 19
Coding simple systems using the ‘Vitamin-C’ language.............................................................. 19
Exercise ................................................................................................................................................ 23
A Closer look ................................................................................................................................... 23
What happens if you make a mistake?................................................................................. 25
Detecting coding errors before you run the code-script. ............................................................. 25
Installing the Free Compiler on your system ........................................................................................ 25
Running A Syntax Check ..................................................................................................................... 25
Correcting coding errors at runtime ............................................................................................. 27
Auto Save feature. ........................................................................................................................... 28
A Brief Introduction to C++.................................................................................................. 29
Predefined Variables and Functions .................................................................................... 30
Predefined Variables............................................................................................................................. 30
Vitamin-C specific functions ................................................................................................................ 30
Predefined Array Variables................................................................................................................... 31
Your Second Step ................................................................................................................... 32
Exercise ................................................................................................................................................ 34
Your Third Step. .................................................................................................................... 35
Corollary.......................................................................................................................................... 40
Exercise ............................................................................................................................................ 42
Your Fourth Step ................................................................................................................... 43
Getting a little bit more serious ! ................................................................................................... 43
Coding a Time Stop......................................................................................................................... 43
Creating a MetaStock Time Stop Expert .............................................................................................. 47
Building a simple Profit Stop Indicator Using Vitamin-C ................................................. 50
Spicing up the Profit Stop. ............................................................................................................. 54
Handling the Short side of the Market.......................................................................................... 55
Building a Trailing Stop function with Vitamin-C.............................................................. 57
Copyright © 2000-2009 by Compuvision Australia Pty Ltd. All Rights Reserved
http://www.compuvision.com.au
Page 2