Login Page - Create Account

Support Board


Date/Time: Fri, 20 Apr 2018 14:36:36 +0000



[User Discussion] - Showing big Time and Sales orders on the chart

Support Request:
[2013-04-08 16:01:05]
pe1111112 - Posts: 35
I see the various Time and Sales studies, but they scroll at their own pace independent of the rate of the chart.

I tried writing a spreadsheet program to place dots below the candles when trades occurred that were over a certain size, but I can't figure out how to get them to stay on the charts. They disappear as soon as Time and Sales scrolls more.

I know this is possible, I just can't figure it out.
[2013-04-09 18:48:41]
User84915 - Posts: 1
You can use 1-tick chart to get all trades instead T&S:

#include "C:\SierraChart\ACS_Source\sierrachart.h"

SCDLLName("Big Lots")

#define BIG_LOTS(sc)\
if(-TickBidVolume[TickIndex] <= -volume1Threshold.IntValue && -TickBidVolume[TickIndex] > -volume2Threshold.IntValue)\
Bid1Volume[sc.Index] = TickPrice[TickIndex];\
else if(-TickBidVolume[TickIndex] <= -volume2Threshold.IntValue && -TickBidVolume[TickIndex] > -volume3Threshold.IntValue)\
Bid2Volume[sc.Index] = TickPrice[TickIndex];\
else if(-TickBidVolume[TickIndex] <= -volume3Threshold.IntValue)\
Bid3Volume[sc.Index] = TickPrice[TickIndex];\
if(TickAskVolume[TickIndex] >= volume1Threshold.IntValue && TickAskVolume[TickIndex] < volume2Threshold.IntValue)\
Ask1Volume[sc.Index] = TickPrice[TickIndex];\
if(TickAskVolume[TickIndex] >= volume2Threshold.IntValue && TickAskVolume[TickIndex] < volume3Threshold.IntValue)\
Ask2Volume[sc.Index] = TickPrice[TickIndex]; \
if(TickAskVolume[TickIndex] >= volume3Threshold.IntValue)\
Ask3Volume[sc.Index] = TickPrice[TickIndex];\
Bid1Volume.DataColor[sc.Index] = RGB(255,0,0);\
Bid2Volume.DataColor[sc.Index] = RGB(255,0,0);\
Bid3Volume.DataColor[sc.Index] = RGB(255,0,0);\
Ask1Volume.DataColor[sc.Index] = RGB(0,255,0);\
Ask2Volume.DataColor[sc.Index] = RGB(0,255,0);\
Ask3Volume.DataColor[sc.Index] = RGB(0,255,0);\

SCSFExport scsf_VolumeEmulated(SCStudyGraphRef sc)
{

int i = 0;
SCSubgraphRef Bid1Volume = sc.Subgraph[i++];
SCSubgraphRef Ask1Volume = sc.Subgraph[i++];
SCSubgraphRef Bid2Volume = sc.Subgraph[i++];
SCSubgraphRef Ask2Volume = sc.Subgraph[i++];
SCSubgraphRef Bid3Volume = sc.Subgraph[i++];
SCSubgraphRef Ask3Volume = sc.Subgraph[i++];
SCSubgraphRef ControlSum = sc.Subgraph[i++];

SCInputRef volume1Threshold = sc.Input[0];
SCInputRef volume2Threshold = sc.Input[1];
SCInputRef volume3Threshold = sc.Input[2];
SCInputRef OneTickChart = sc.Input[3];


int& TickIndex = sc.PersistVars->i1;

if (sc.SetDefaults)
{
sc.GraphName = "Big Lots";
sc.StudyDescription = "Big Lots";
sc.GraphRegion = 0;
sc.DrawZeros = 0;
sc.GraphDrawType = GDT_CUSTOM;

sc.FreeDLL = 1;
sc.AutoLoop = 1;

OneTickChart.Name = "1-tick chart";
OneTickChart.SetChartNumber(1);

Bid1Volume.Name = "Bid 1 Volume";
Bid1Volume.DrawStyle = DRAWSTYLE_TRIANGLEDOWN;
Bid1Volume.LineWidth = 2;
Bid1Volume.PrimaryColor = RGB(128,0,128);

Bid2Volume.Name = "Bid 2 Volume";
Bid2Volume.DrawStyle = DRAWSTYLE_TRIANGLEDOWN;
Bid2Volume.LineWidth = 4;
Bid1Volume.PrimaryColor = RGB(128,0,128);

Bid3Volume.Name = "Bid 3 Volume";
Bid3Volume.DrawStyle = DRAWSTYLE_TRIANGLEDOWN;
Bid3Volume.LineWidth = 6;
Bid1Volume.PrimaryColor = RGB(128,0,128);

Ask1Volume.Name = "Ask 1 Volume";
Ask1Volume.DrawStyle = DRAWSTYLE_TRIANGLEUP;
Ask1Volume.LineWidth = 2;
Ask1Volume.PrimaryColor = RGB(0,128,128);

Ask2Volume.Name = "Ask 2 Volume";
Ask2Volume.DrawStyle = DRAWSTYLE_TRIANGLEUP;
Ask2Volume.LineWidth = 4;
Ask1Volume.PrimaryColor = RGB(0,128,128);

Ask3Volume.Name = "Ask 3 Volume";
Ask3Volume.DrawStyle = DRAWSTYLE_TRIANGLEUP;
Ask3Volume.LineWidth = 6;
Ask1Volume.PrimaryColor = RGB(0,128,128);

volume1Threshold.Name = "Volume 1 Threshold";
volume1Threshold.SetInt(20);
    
volume2Threshold.Name = "Volume 2 Threshold";
volume2Threshold.SetInt(40);

volume3Threshold.Name = "Volume 3 Threshold";
volume3Threshold.SetInt(100);

return;
}

SCGraphData OneTickGraphData;
sc.GetChartBaseData(OneTickChart.GetChartNumber(), OneTickGraphData);
SCFloatArrayRef TickVolume = OneTickGraphData[SC_VOLUME];
SCFloatArrayRef TickAskVolume = OneTickGraphData[SC_ASKVOL];
SCFloatArrayRef TickBidVolume = OneTickGraphData[SC_BIDVOL];
SCFloatArrayRef TickPrice = OneTickGraphData[SC_LAST];
if(TickVolume.GetArraySize() == 0)
    {
      return;
    }

if (sc.Index == 0)
{
TickIndex = 0;
}
while (TickIndex < TickVolume.GetArraySize())
{
if(sc.Index < sc.ArraySize - 1)
{
if(ControlSum[sc.Index] +1 <= sc.NumberOfTrades[sc.Index])
{
  BIG_LOTS(sc)
  ControlSum[sc.Index]++;
}
else
{
break;
}
}
if(sc.Index == sc.ArraySize - 1)
{
if(ControlSum[sc.Index] <= sc.NumberOfTrades[sc.Index])
{
BIG_LOTS(sc)
ControlSum[sc.Index]++;
}
}
TickIndex++;
}
}
For correct result check "UseControlledOrderChartUpdating" option.
Date Time Of Last Edit: 2013-04-09 18:56:29

To post a message in this thread, you need to login with your Sierra Chart account:

Login


Login Page - Create Account