Plot bid traded vs ask traded

Questions about MultiCharts and user contributed studies.
Abhi
Posts: 28
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 2 times

Plot bid traded vs ask traded

Postby Abhi » 08 Jun 2016

Hi, I want to plot cumulative volume on the ask side and bid side for a bar, but all it plots is upticks vs downticks. Anybody has any idea how to calculate cumulative volume on the bid and ask side.

This is very similar to cumulative delta but with more info. Easylanguage code below.
[+] show the code

Code: Select all

Variables:

TickSize( MinMove / PriceScale ),
VolumeDelta(0),
TotalVolume(0),
VolumeUptick(0),
VolumeDowntick(0),
LeftMostLocationOnChart(0),
VerticalLocation(0);

VerticalLocation = GetAppInfo(aiLowestDispValue) + TickSize;
LeftMostLocationOnChart = GetAppInfo(aiLeftDispDateTime);
VolumeDelta = UpTicks - DownTicks;
TotalVolume = UpTicks + DownTicks;
VolumeUptick = UpTicks;
VolumeDowntick = DownTicks;

Value99 = Text_New(Date, Time, 0, " ");
Text_SetString(Value99, "Delta" );
Text_SetLocation(Value99, Date, GetAppInfo(aiRightDispDateTime) , VerticalLocation + 3*TickSize);
Text_SetStyle(Value99, 2, 2);
Text_setColor(Value99, Yellow);

Value98 = Text_New(Date, Time, 0, " ");
Text_SetString(Value98, "Total Volume" );
Text_SetLocation(Value98, Date, GetAppInfo(aiRightDispDateTime), VerticalLocation);
Text_SetStyle(Value98, 2, 2);
text_setColor(Value98, Cyan);

Value97 = Text_New(Date, Time, 0, " ");
Text_SetString(Value97, "UpTicks");
Text_SetLocation(Value97, Date, GetAppInfo(aiRightDispDateTime), VerticalLocation + 2*TickSize);
Text_SetStyle(Value97, 2, 2);
text_setColor(Value97, Green);

Value96 = Text_New(Date, Time, 0, " ");
Text_SetString(Value96, "DownTicks");
Text_SetLocation(Value96, Date, GetAppInfo(aiRightDispDateTime), VerticalLocation + 1*TickSize);
Text_SetStyle(Value96, 2, 2);
text_setColor(Value96, Red);



If VolumeDelta >= 0 Then
Begin

{If Datetime = LeftMostLocationOnChart Then
Begin

Value99 = Text_New(Date, Time, 0, " ");
Text_SetString(Value99, "Delta" );
Text_SetLocation(Value99, Date, Time, VerticalLocation + 3*TickSize);
Text_SetStyle(Value99, 2, 2);
Text_setColor(Value99, Yellow);

Value98 = Text_New(Date, Time, 0, " ");
Text_SetString(Value98, "Total Volume" );
Text_SetLocation(Value98, Date, Time, VerticalLocation);
Text_SetStyle(Value98, 2, 2);
text_setColor(Value98, Cyan);

Value97 = Text_New(Date, Time, 0, " ");
Text_SetString(Value97, "UpTicks");
Text_SetLocation(Value97, Date, Time, VerticalLocation + 2*TickSize);
Text_SetStyle(Value97, 2, 2);
text_setColor(Value97, Green);

Value96 = Text_New(Date, Time, 0, " ");
Text_SetString(Value96, "DownTicks");
Text_SetLocation(Value96, Date, Time, VerticalLocation + 1*TickSize);
Text_SetStyle(Value96, 2, 2);
text_setColor(Value96, Red);

End;}

Value99 = Text_New(Date, Time, 0, " ");
Text_SetString(Value99, numtostr(VolumeDelta,0) );
Text_SetLocation(Value99, Date, Time, VerticalLocation + 3*TickSize);
Text_SetStyle(Value99, 2, 2);
Text_setColor(Value99, Green);



Value98 = Text_New(Date, Time, 0, " ");
Text_SetString(Value98, numtostr(TotalVolume,0) );
Text_SetLocation(Value98, Date, Time, VerticalLocation);
Text_SetStyle(Value98, 2, 2);
text_setColor(Value98, Cyan);

Value97 = Text_New(Date, Time, 0, " ");
Text_SetString(Value97, numtostr(VolumeUptick,0) );
Text_SetLocation(Value97, Date, Time, VerticalLocation + 2*TickSize);
Text_SetStyle(Value97, 2, 2);
text_setColor(Value97, Green);

Value96 = Text_New(Date, Time, 0, " ");
Text_SetString(Value96, numtostr(VolumeDowntick,0) );
Text_SetLocation(Value96, Date, Time, VerticalLocation + 1*TickSize);
Text_SetStyle(Value96, 2, 2);
text_setColor(Value96, Red);

End
Else
Begin

{If Datetime = LeftMostLocationOnChart Then
Begin

Value99 = Text_New(Date, Time, 0, " ");
Text_SetString(Value99, "Delta" );
Text_SetLocation(Value99, Date, Time, VerticalLocation + 3*TickSize);
Text_SetStyle(Value99, 2, 2);
Text_setColor(Value99, Yellow);

Value98 = Text_New(Date, Time, 0, " ");
Text_SetString(Value98, "Total Volume" );
Text_SetLocation(Value98, Date, Time, VerticalLocation);
Text_SetStyle(Value98, 2, 2);
text_setColor(Value98, Cyan);

Value97 = Text_New(Date, Time, 0, " ");
Text_SetString(Value97, "UpTicks");
Text_SetLocation(Value97, Date, Time, VerticalLocation + 2*TickSize);
Text_SetStyle(Value97, 2, 2);
text_setColor(Value97, Green);

Value96 = Text_New(Date, Time, 0, " ");
Text_SetString(Value96, "DownTicks");
Text_SetLocation(Value96, Date, Time, VerticalLocation + 1*TickSize);
Text_SetStyle(Value96, 2, 2);
text_setColor(Value96, Red);

End;}

Value99 = Text_New(Date, Time, 0, " ");
Text_SetString(Value99, numtostr(VolumeDelta,0) );
Text_SetLocation(Value99, Date, Time, VerticalLocation + 3*TickSize);
Text_SetStyle(Value99, 2, 2);
Text_setColor(Value99, Red);


Value98 = Text_New(Date, Time, 0, " ");
Text_SetString(Value98, numtostr(TotalVolume,0) );
Text_SetLocation(Value98, Date, Time, VerticalLocation );
Text_SetStyle(Value98, 2, 2);
text_setColor(Value98, Cyan);

Value97 = Text_New(Date, Time, 0, " ");
Text_SetString(Value97, numtostr(VolumeUptick,0) );
Text_SetLocation(Value97, Date, Time, VerticalLocation + 2*TickSize);
Text_SetStyle(Value97, 2, 2);
text_setColor(Value97, Green);

Value96 = Text_New(Date, Time, 0, " ");
Text_SetString(Value96, numtostr(VolumeDowntick,0) );
Text_SetLocation(Value96, Date, Time, VerticalLocation + 1*TickSize);
Text_SetStyle(Value96, 2, 2);
text_setColor(Value96, Red);

End;
Attachments
Screenshot.png
Screenshot.png (77.83 KiB) Viewed 1157 times

User avatar
TJ
Posts: 7192
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 990 times
Been thanked: 2049 times

Re: Plot bid traded vs ask traded

Postby TJ » 08 Jun 2016

see post 1 & 2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713

User avatar
TJ
Posts: 7192
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 990 times
Been thanked: 2049 times

Re: Plot bid traded vs ask traded

Postby TJ » 09 Jun 2016

Hi, I want to plot cumulative volume on the ask side and bid side for a bar, but all it plots is upticks vs downticks. Anybody has any idea how to calculate cumulative volume on the bid and ask side.

This is very similar to cumulative delta but with more info. Easylanguage code below.
::
Open your PowerLanguage Editor and look for this indicator:

--- Market Depth on Chart ---

Abhi
Posts: 28
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 2 times

Re: Plot bid traded vs ask traded

Postby Abhi » 09 Jun 2016

Hi, I want to plot cumulative volume on the ask side and bid side for a bar, but all it plots is upticks vs downticks. Anybody has any idea how to calculate cumulative volume on the bid and ask side.

This is very similar to cumulative delta but with more info. Easylanguage code below.
::
Open your PowerLanguage Editor and look for this indicator:

--- Market Depth on Chart ---

Thank you for the pointer. Will have a look.

Abhi
Posts: 28
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 2 times

Re: Plot cumulative volume against bid and ask for a bar

Postby Abhi » 09 Jun 2016

I want to plot the cumulative volume against each bar as opposed to just calculate the cumulative volume. Multicharts support any suggestions.

The cumulative delta chart is not that informative about each bar.

User avatar
Henry MultiСharts
Posts: 9093
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 times

Re: Plot cumulative volume against bid and ask for a bar

Postby Henry MultiСharts » 10 Jun 2016

I want to plot the cumulative volume against each bar as opposed to just calculate the cumulative volume. Multicharts support any suggestions.

The cumulative delta chart is not that informative about each bar.
Hello Abhi,

You can set the required resolution as well as the Breakdown type in the Cumulative Delta Chart Type settings.

Abhi
Posts: 28
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 2 times

Re: Plot bid traded vs ask traded

Postby Abhi » 10 Jun 2016

Hi Henry, Thanks for the note. May be I was not clear in my previous post, apologies. The attached is a ask traded vs bid traded chart.

For the highlighted bar the volume traded on the ask side = 170+352+395+25 = 942

The volume traded on the bid side = 67 + 372 + 756 + 301 = 1496

I want to calculate these volumes for each bar not the upticks and downticks for each bar. And I think this will be very beneficial indicator to other traders. Please could you suggest some tips.
Attachments
Screenshot.png
Screenshot.png (90.52 KiB) Viewed 1178 times

User avatar
Henry MultiСharts
Posts: 9093
Joined: 25 Aug 2011
Has thanked: 1258 times
Been thanked: 2923 times

Re: Plot bid traded vs ask traded

Postby Henry MultiСharts » 14 Jun 2016

Hi Henry, Thanks for the note. May be I was not clear in my previous post, apologies. The attached is a ask traded vs bid traded chart.

For the highlighted bar the volume traded on the ask side = 170+352+395+25 = 942

The volume traded on the bid side = 67 + 372 + 756 + 301 = 1496

I want to calculate these volumes for each bar not the upticks and downticks for each bar. And I think this will be very beneficial indicator to other traders. Please could you suggest some tips.
Hello Abhi,

There is no way to calculate these values separately for ask and bid sides in PowerLanguage. Such study can be created in MultiCharts .NET only. In PowerLanguage you can get the total Delta value per bar (Close - Close[1]) on Cumulative Delta chart.


Return to “MultiCharts”