Is anyone familiar with the Accumulation Distribution Strategy that it appears Jim may have code for an old Stocks and Commodities magazine article. The strategy looks really interesting but a little difficult for me to grasp as just learning C Sharp.
I was wondering if it could be applied to futures contracts?
I can't quite figure out how to add a EnterShort() section of code ?
Right now it only goes long, for educational purposes only if anyone has given it a shot or can offer suggestions on adding code to also go short that would be great.
Was also wondering if this would be an applicable strategy for non time based charts like renko/unirenko where volume is not available?
Thanks for the help I wish I had a few days to really study this strategy but unfortunately barely keeping my head above water implementing a few automated trading strategies.
Here is a portion of the code to see if it rings any bells?
protected override void OnBarUpdate()
{
if (CurrentBar < Length || CurrentBar < 12 || CurrentBar < VolAvg || CurrentBar < VolDelay)
return;
// Persist previous Top and Bot
Top[0] = Top[1];
Bot[0] = Bot[1];
Range_[0] = MAX(High, Length)[0] - MIN(Low, Length)[0];
if (Range_[0] < ConsolidationFactor * Range_[Length])
{
Top[0] = MAX(High, Length)[0];
Bot[0] = MIN(Low, Length)[0];
}
if (ToDay(Time[0]) > 20030101 && Close[0] > Top[0] && Bot[0] > Bot[12]
&& SMA(Volume, VolAvg)[VolDelay] > VolRatio * SMA(Volume, VolAvg)[VolAvg + VolDelay])
{
int ProfitQuantity = 0;
if (TradeProfit)
ProfitQuantity = (int)Math.Floor(SystemPerformance.RealTimeTrades.T radesPerformance.NetProfit / Close[0]);
EnterLong((int)Math.Floor(AmountToBuy / Close[0]) + ProfitQuantity);
}
if (Position.MarketPosition == MarketPosition.Long && Close[0] < Bot[0])
ExitLong();
}
Comment