|
QuantShare
2010-11-09 04:01:00
0
|
|
Best Answer
- You can use the QuantShare vector-based language to create such strategy.
Example:
djiRule = Ticker("^DJI",close,LastData);
rule1 = sma(djiRule, 10) > sma(djiRule, 20);
rule2 = (close == hhv(100));
buy = rule1 AND rule2;
- Using the money management script to check for a specific value:
MMParser parser = Data.ParseFormula("a = sma(10) > sma(20);");
TimeSeries dji = parser.GetTimeSeries("^DJI", "a");
int dowbuy = (int)dji[0];
- To persist a variable value across multiple periods, use the "Variables" class:
Variables.SetVariable("variable name", 10);
int result = (int)Variables.GetVariable("variable name");
|
|