On a time and sales window for sterling it's red for a downtick, and green for an uptick.
Where do you get this info in the API?
Thanks
Where do you get this info in the API?
Thanks
Quote from WinstonTJ:
Did you read the technical documentation?
Why not record two ticks in sequence? If the print at 9:30.000 was $10.00 and the tick/print at 9:30.100 is $10.01 then you know it is an uptick.
= Current Tick - Last Tick
Use IF statements:
IF difference = positive then uptick
IF difference = negative then downtick
using TradeLink.API;
using TradeLink.Common;
public class MyResponse : ResponseTemplate
{
TickTracker kt = new TickTracker();
public override void GotTick(Tick k)
{
// track ticks
kt.newTick(k);
// wait until we have two trades
if (!k.isTrade || kt[k.symbol].isTrade) return;
// check for uptick/downtick
if (k.trade > kt[k.symbol].trade)
senddebug("uptick at "+k.time);
else if (k.trade < kt[k.symbol].trade)
senddebug("downtick at "+k.time);
}
}
Quote from tradelink:
here is how to do this in tradelink (which will work with sterling or any tradelink broker) :
Code:using TradeLink.API; using TradeLink.Common; public class MyResponse : ResponseTemplate { TickTracker kt = new TickTracker(); public override void GotTick(Tick k) { // track ticks kt.newTick(k); // wait until we have two trades if (!k.isTrade || kt[k.symbol].isTrade) return; // check for uptick/downtick if (k.trade > kt[k.symbol].trade) senddebug("uptick at "+k.time); else if (k.trade < kt[k.symbol].trade) senddebug("downtick at "+k.time); } }
TradeLink is 100% free and open source and works with 12+ brokers.
http://tradelink.googlecode.com
using TradeLink.API;
using TradeLink.Common;
public class MyResponse : ResponseTemplate
{
TickTracker kt = new TickTracker();
public override void GotTick(Tick k)
{
// track ticks
kt.newTick(k);
// wait until we have required data
if (!k.isTrade || !kt.HasAll(k.symbol)) return;
// check for bid uptick/downtick
if ((k.trade==kt[k.symbol].bid) && (k.trade > kt[k.symbol].trade))
senddebug("hit bid uptick at "+k.time);
else if ((k.trade==kt[k.symbol].bid) && (k.trade < kt[k.symbol].trade))
senddebug("hit bid downtick at "+k.time);
else if ((k.trade==kt[k.symbol].ask) && (k.trade < kt[k.symbol].trade))
senddebug("takes offer downtick at "+k.time);
else if ((k.trade==kt[k.symbol].ask) && (k.trade > kt[k.symbol].trade))
senddebug("takes offer uptick at "+k.time);
}
}