Hi,
watching the great indicator for the Time&Sales posted in this section, I'd like to create in the right margin of the Workspace a series of strings which plots the Volume at Price strings for the last session.
If you apply it on a 1 tick chart, each line would plot the # of shares/contracts traded in the last session.
I've create a code, but something doesn't work because it doesn't plot what I want and the print statement in the bottom of the code tells me that I'm wrong somewhere.
See the code attached
Any suggestion will be very appreciated.
Regards
CrazyNasdaq
Volume @ Price String in the right margin of the workspace
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Volume @ Price String in the right margin of the workspace
- Attachments
-
- V@P_string.txt
- (2.13 KiB) Downloaded 625 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Volume @ Price String in the right margin of the workspa
you should also post a mock up picture.
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
Here is what I would like to plotyou should also post a mock up picture.
See the picture attached
- Attachments
-
- V@PString.png
- (29.17 KiB) Downloaded 2166 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Volume @ Price String in the right margin of the workspa
do a search for an indicator named "TPO".
it has most of the code components you need.
it has most of the code components you need.
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
OK !!do a search for an indicator named "TPO".
it has most of the code components you need.
Thanks
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
I've made some adjustments and it seems to work now even if not well as it should, infact there are a couple of things that don't work fine and I don't know where the problem could be.
Attached you can find some pictures from different instruments with different price scale settings.
All the settings are correct in the Quotemanager for the minmovment, price scale and so on.
So the problem should be in the code.
I've attached also the TXT files from the statement generated from the code for each instrument. The variables, iPrice and Volume are all correct but the string plotting is not so correct.
The first problem is this:
What I notice is that the code works fine and displays for each level of price the correct volume if applied on instruments with price-scale "AS IS" or with no decimals in each minimum movment (FESX , YM). If you apply the code to instruments with price-scale in decimals (ES, NQ, 6E, FDAX, FGBL .....), it displays only the volume for the integer price and not for the decimals.
For example on the €/USD future (6E), it displays only one string even if I've plotted it on 1 tick chart where the average price is equal to close for each tick and iPrice is equal to average price.
The second problem is how to maintain the vertical alignment for the all strings at each new quote. After some seconds, the vertical alignment is lost and you find strings in the middle of the chart. Only the strings referencing the last quotes stay in the right margin of the chart.
Here is the code that I've made for the Volume@Price_string. Any help or suggestion will be very appreciated.
CrazyNasdaq
Attached you can find some pictures from different instruments with different price scale settings.
All the settings are correct in the Quotemanager for the minmovment, price scale and so on.
So the problem should be in the code.
I've attached also the TXT files from the statement generated from the code for each instrument. The variables, iPrice and Volume are all correct but the string plotting is not so correct.
The first problem is this:
What I notice is that the code works fine and displays for each level of price the correct volume if applied on instruments with price-scale "AS IS" or with no decimals in each minimum movment (FESX , YM). If you apply the code to instruments with price-scale in decimals (ES, NQ, 6E, FDAX, FGBL .....), it displays only the volume for the integer price and not for the decimals.
For example on the €/USD future (6E), it displays only one string even if I've plotted it on 1 tick chart where the average price is equal to close for each tick and iPrice is equal to average price.
The second problem is how to maintain the vertical alignment for the all strings at each new quote. After some seconds, the vertical alignment is lost and you find strings in the middle of the chart. Only the strings referencing the last quotes stay in the right margin of the chart.
Here is the code that I've made for the Volume@Price_string. Any help or suggestion will be very appreciated.
Code: Select all
//CrazyNasdaq date 20101012
//Volume@Price string
//version beta 0.1
Inputs: Txt.Color(red),
Txt.Size(8),
Txt.Bold(false),
Txt.Font("verdana");
Vars: StartPrice(0),
iPrice(0),
MyVolume(0);
Array: Vol.Array[15000](0),
Vol.Txt[15000](0),
Vol.Str[15000](" --- ");
If date = lastcalcdate then begin //this statement make the code begin only if the day is the last day on the chart
MyVolume = Volume;
// Reset Each day at the first TICK
if date > date[1] then begin
iPrice = AvgPrice;
StartPrice = AvgPrice;
for value1 = 0 to 15000 begin //this statement reset all the array to zero
Vol.Array[value1] = 0;
END;
Vol.Array[iPrice] = MyVolume; //this statement assigns the Volume to the first tick of the array
END;
// Calculate the value for the rest of the day past the first TICK
If date = date[1]and StartPrice > 0 then begin
iPrice = avgprice; //is suggested to use 1 tick chart
Vol.Array[iPrice]= Vol.Array[iPrice] + MyVolume; //this collects volume at each new tick and summs Volume with previous volume
END;
Vol.Str[iPrice] = numtostr(Vol.Array[iPrice],0); //this transform numbers of the Volume @ each Price in strings to display
text_Delete(vol.txt[iprice]); //this is to not rewrite the string on the previous string
vol.txt[iPrice]=text_new(d, getAppInfo(aiRightDispDateTime),iPrice,"text string");
text_setstyle(vol.txt[iPrice],1,2);
text_setcolor(vol.txt[iPrice],getbackgroundcolor);
text_setstring(vol.txt[iPrice], vol.str[iPrice]+ " ");
text_setcolor(vol.txt[iPrice],Txt.Color);
Text_SetSize(Vol.txt[iPrice], txt.Size);
text_setattribute(Vol.txt[iPrice], 1 , txt.bold);
text_setfontname(Vol.txt[iPrice], txt.font);
text_setlocation(Vol.txt[iPrice], d, getappinfo(airightdispdatetime), iprice);
{This is the statement that creates the TXT file to control if the code works fine}
Print(File("C:/temp/Volumestring_"+Getsymbolname+".txt")," ",numtostr(date,0), " ", numtostr(time_s,0), " ", numtostr(iprice, 4)," ", numtostr(Vol.Array[iPrice],0));
END;
- Attachments
-
- 6E V@P.png
- (29.33 KiB) Downloaded 2050 times
-
- NQZ0 V@P.png
- (33.16 KiB) Downloaded 2008 times
-
- FDAX V@P.png
- (39.85 KiB) Downloaded 2011 times
-
- YM V@P.png
- (37.78 KiB) Downloaded 1987 times
-
- FESX V@P.png
- (34.02 KiB) Downloaded 2015 times
Last edited by CrazyNasdaq on 16 Oct 2010, edited 1 time in total.
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
These are the TXT statements generated from the code.
Attached.
P.S.
This feature could be very interesting to have as default in a next release of Multicharts, as the Volume Profile that already is in the right margin of the workspace.
It could be a utility as many DOM now have to implement in MC.
Attached.
P.S.
This feature could be very interesting to have as default in a next release of Multicharts, as the Volume Profile that already is in the right margin of the workspace.
It could be a utility as many DOM now have to implement in MC.
- Attachments
-
- V@P_String_Statement_files_txt.rar
- (561.62 KiB) Downloaded 369 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Volume @ Price String in the right margin of the workspa
the texts appear on the chart because you put them there...
the chart increments with time and new data...
and the the bars move to the left.
if you want the texts to stay at the right hand edge,
you have to re-position them through TEXT_SETLOCATION at the beginning of each bar.
the chart increments with time and new data...
and the the bars move to the left.
if you want the texts to stay at the right hand edge,
you have to re-position them through TEXT_SETLOCATION at the beginning of each bar.
-
- Posts: 310
- Joined: 02 Nov 2010
- Has thanked: 26 times
- Been thanked: 23 times
Re: Volume @ Price String in the right margin of the workspa
Hi CrazyNasdaq using volume is it poissible to find HFT enter in the markets and if they are going long or short?
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
Sorry, but what is the matter with this thread ?Hi CrazyNasdaq using volume is it poissible to find HFT enter in the markets and if they are going long or short?
What HFT matters with Volume@Price string ?
-
- Posts: 310
- Joined: 02 Nov 2010
- Has thanked: 26 times
- Been thanked: 23 times
-
- Posts: 310
- Joined: 02 Nov 2010
- Has thanked: 26 times
- Been thanked: 23 times
Re: Volume @ Price String in the right margin of the workspa
so WITH THIS INDICATOR COULD U FIND hft?
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
This indicator is not designed to identify HFT, it's only a numerical expression of Volume profile, very accurate ( 1 tick accurate).so WITH THIS INDICATOR COULD U FIND hft?
HFT with this indicator doesn't matter at all
You are searching here something different from what I've posted here
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Volume @ Price String in the right margin of the workspa
so WITH THIS INDICATOR COULD U FIND hft?
This indicator is not designed to identify HFT, it's only a numerical expression of Volume profile, very accurate ( 1 tick accurate).
HFT with this indicator doesn't matter at all
You are searching here something different from what I've posted here
I can see that you have worked out the text location problem.
The effect looks good.
- CrazyNasdaq
- Posts: 321
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 98 times
- Been thanked: 89 times
Re: Volume @ Price String in the right margin of the workspa
Yes, but the text location is modified from the original project because if I put it on the right edge of the screen with Getappinfo(aiRightDispDateTime ) it becomes too CPU intensive because of it calculates on each tick and on each tick the code should position all the strings.