Esempio n. 1
0
int
OHLC::settings (PluginData *pd)
{
  Entity *command = new Entity;
  BarType bt;
  CurveOHLCType ct;
  CurveLineType clt;
  MAType mat;
  
  command->set(QString("plugin"), new QVariant(QString("OHLC")));
  command->set(QString("type"), new QVariant(QString("indicator")));
  
  command->set(QString("style"), new QVariant(ct.indexToString(CurveOHLCType::_OHLC)));
  command->set(QString("upColor"), new QVariant(QString("green")));
  command->set(QString("downColor"), new QVariant(QString("red")));
  command->set(QString("neutralColor"), new QVariant(QString("blue")));
  command->set(QString("label"), new QVariant(QString("OHLC")));

  // ma 1
  command->set(QString("ma1Input"), new QVariant(bt.indexToString(BarType::_CLOSE)));
  command->set(QString("ma1Type"), new QVariant(mat.indexToString(MAType::_EMA)));
  command->set(QString("ma1Style"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  command->set(QString("ma1Width"), new QVariant(1));
  command->set(QString("ma1Color"), new QVariant(QString("yellow")));
  command->set(QString("ma1Period"), new QVariant(20));
  command->set(QString("ma1Label"), new QVariant(QString("MA1")));

  // ma 2
  command->set(QString("ma2Input"), new QVariant(bt.indexToString(BarType::_CLOSE)));
  command->set(QString("ma2Type"), new QVariant(mat.indexToString(MAType::_EMA)));
  command->set(QString("ma2Style"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  command->set(QString("ma2Width"), new QVariant(1));
  command->set(QString("ma2Color"), new QVariant(QString("red")));
  command->set(QString("ma2Period"), new QVariant(50));
  command->set(QString("ma2Label"), new QVariant(QString("MA2")));

  // ma 3
  command->set(QString("ma3Input"), new QVariant(bt.indexToString(BarType::_CLOSE)));
  command->set(QString("ma3Type"), new QVariant(mat.indexToString(MAType::_EMA)));
  command->set(QString("ma3Style"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  command->set(QString("ma3Width"), new QVariant(1));
  command->set(QString("ma3Color"), new QVariant(QString("blue")));
  command->set(QString("ma3Period"), new QVariant(200));
  command->set(QString("ma3Label"), new QVariant(QString("MA3")));
  
  pd->settings = command;
  
  return 1;
}
Esempio n. 2
0
int
Volume::settings (PluginData *pd)
{
  Entity *command = new Entity;
  
  // plugin
  command->set(QString("plugin"), new QVariant(QString("Volume")));
  command->set(QString("type"), new QVariant(QString("indicator")));
  command->set(QString("upColor"), new QVariant(QString("green")));
  command->set(QString("downColor"), new QVariant(QString("red")));
  command->set(QString("neutralColor"), new QVariant(QString("blue")));
  command->set(QString("label"), new QVariant(QString("VOL")));

  MAType mat;
  command->set(QString("maType"), new QVariant(mat.indexToString(MAType::_EMA)));

  // style
  CurveLineType clt;
  command->set(QString("maStyle"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  
  command->set(QString("maWidth"), new QVariant(1));
  command->set(QString("maColor"), new QVariant(QString("yellow")));
  command->set(QString("maPeriod"), new QVariant(10));
  command->set(QString("maLabel"), new QVariant(QString("MA")));
  
  pd->settings = command;
  
  return 1;
}
Esempio n. 3
0
int
RSI::settings (PluginData *pd)
{
  BarType bt;
  CurveLineType clt;
  MAType mat;
  Entity *command = new Entity;
  
  command->set(QString("plugin"), new QVariant(QString("RSI")));
  command->set(QString("type"), new QVariant(QString("indicator")));
  
  command->set(QString("input"), new QVariant(bt.indexToString(BarType::_CLOSE)));
  command->set(QString("color"), new QVariant(QString("red")));
  command->set(QString("period"), new QVariant(14));
  command->set(QString("label"), new QVariant(QString("RSI")));
  command->set(QString("width"), new QVariant(1));
  command->set(QString("style"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  command->set(QString("rsiShow"), new QVariant(TRUE));
  
  command->set(QString("maType"), new QVariant(mat.indexToString(MAType::_EMA)));
  command->set(QString("maStyle"), new QVariant(clt.indexToString(CurveLineType::_SOLID)));
  command->set(QString("maWidth"), new QVariant(1));
  command->set(QString("maColor"), new QVariant(QString("yellow")));
  command->set(QString("maPeriod"), new QVariant(10));
  command->set(QString("maLabel"), new QVariant(QString("MA")));
  command->set(QString("maShow"), new QVariant(TRUE));
  
  command->set(QString("buyMarkerColor"), new QVariant(QString("green")));
  command->set(QString("buyMarkerPrice"), new QVariant(30.0));
  command->set(QString("buyMarkerShow"), new QVariant(TRUE));

  command->set(QString("sellMarkerColor"), new QVariant(QString("red")));
  command->set(QString("sellMarkerPrice"), new QVariant(70.0));
  command->set(QString("sellMarkerShow"), new QVariant(TRUE));
  
  pd->settings = command;
  
  return 1;
}