My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
LessonTalib  
Using 100+ common indicators in TradeLink
Updated May 13, 2011 by j...@pracplay.com

Introduction

In this guide we're going to cover using these indicators

Determine Indicator

View list of indicators.

Determine Indicator Data Source

  • Generally indicators work with bar data.
  • this means you will need to configure a barlisttracker and your desired bar intervals

Here's an idea :

BarListTracker blt = new BarListTracker();
public MyResponse()
{
   blt.NewBar+=new SymbolIntDelegate(newbar);
}

GenericTracker<decimal> MA = new GenericTracker<decimal("MA");
void newbar(string symbol, int interval)
{
   // get tracker index for our symbol
   int idx = MA.getindex(symbol);
   // get some data
   BarList bl = blt[symbol,interval]
   // convert it to form that ta-lib understands
   double[] closes = Calc.Decimal2Double(bl.Close());
   // call your indicator
   double[] ma = new double[closes.Length];
   int bi,oi;
   Core.SMA(0,closes.Length-1,closes,bi,oi,ma);
   // populate your tracker with most recent value
   Calc.TAPopulateGT(idx,oi,ref ma,MA);
   
}
void GotTick(Tick k)
{
   blt.newTick(k);
}


Sign in to add a comment
Powered by Google Project Hosting