Hi guys, i am new but i am overwhlem by how great Quantconnect with VS is !!
previously was using QC web.. didn't get use to doing coding in browser... everything was slow and looking at documentation/classes/methods/interfiles is a hassles.
i need some help understanding how to handle MACD
public override void Initialize()
{
foreach (var ForexPair in _pairs)
{
_symbols.Add(AddForex(ForexPair, Resolution.Minute, "OANDA", leverage: _leverage).Symbol);
_macd = MACD(ForexPair, 12, 26, 9, MovingAverageType.Exponential, Resolution.Minute);
_macdDic.Add(ForexPair, _macd); //MACD value is return here.
}
}
public override void OnData(Slice data)
{
foreach (string ForexPair in _symbols) //as you can see i have many forexpairs.
{
var tolerance = 0.0025m;
Debug(_macd[ForexPair].Histogram); << doing this will give me error. how do i access different forex pairs _macd values?
Debug(_macdDic[ForexPair]); << while this is ok as MACD return values is already store d in Initialize()
}
}
as for shortselling in forex how do i do it correctly
X = "EURUSD" // etc etc
SetHoldings(X, 0.01); //execute buy by pecentage
var s = Securities[X].Holdings;
below are 2 method to sell or close.
Liquidate(X); //execute close << this is ok
MarketOrder(X, s.Quantity); <<< this is not working correctly for me any idea...
i would like MarketOrder to work as this can close partial trade quantity, doing a reversal trade as well etc.. more flexible.
thanks for reading.