Bonds settings [SOLVED]
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Bonds settings
I'm having some difficulty in setting the bond settings.
When selecting Symbol Dictionary using IQFeed for TY I have the following:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1000
Min Movement - 5
Big Point Value - 1000
For US I have:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1000
Min Movement - 10
Big Point Value - 1000
But when using IB symbols I get different settings.
For ZN (TY) I have:
Price Scale - 1/32 and S of 32nd
Daily Limit - 1
Min Movement - 1
Big Point Value - 1000
For ZB (US) I have:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1
Min Movement - 10
Big Point Value - 1000
Which one is the correct one?
Thanks,
Fernando
When selecting Symbol Dictionary using IQFeed for TY I have the following:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1000
Min Movement - 5
Big Point Value - 1000
For US I have:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1000
Min Movement - 10
Big Point Value - 1000
But when using IB symbols I get different settings.
For ZN (TY) I have:
Price Scale - 1/32 and S of 32nd
Daily Limit - 1
Min Movement - 1
Big Point Value - 1000
For ZB (US) I have:
Price Scale - 1/32 and 10th of 32nd
Daily Limit - 1
Min Movement - 10
Big Point Value - 1000
Which one is the correct one?
Thanks,
Fernando
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
I'm also having problems with the quotes themselves.
MC is quoting TY(ZN) at 133.17/32 but on a study we are getting 133.53 which is 17/32. If we take a trade at 133.17/32 we trade at 133.17 and not at 133.53.
How can I resolve this? How can I have my studies show 133.17 instead of 133.53?
MC is quoting TY(ZN) at 133.17/32 but on a study we are getting 133.53 which is 17/32. If we take a trade at 133.17/32 we trade at 133.17 and not at 133.53.
How can I resolve this? How can I have my studies show 133.17 instead of 133.53?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Bonds settings
Hello Arnie,
Each data feed provides data in his own format.
If you are using IQfeed for data and IB as broker then I would recommend you to set the IB settings for IQfeed instrument.
For indicator make sure that Scaling is set to "Same as instrument" in Format->Study->Format->Scaling.
For signal make sure you have enough precision for the output:
This code will output 4 digits after the decimal.
Each data feed provides data in his own format.
If you are using IQfeed for data and IB as broker then I would recommend you to set the IB settings for IQfeed instrument.
Are you referring to an indicator plot or signal output?MC is quoting TY(ZN) at 133.17/32 but on a study we are getting 133.53 which is 17/32. If we take a trade at 133.17/32 we trade at 133.17 and not at 133.53.
How can I resolve this? How can I have my studies show 133.17 instead of 133.53?
For indicator make sure that Scaling is set to "Same as instrument" in Format->Study->Format->Scaling.
For signal make sure you have enough precision for the output:
Code: Select all
print(close:1:4);
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Something simple:
I'm getting the same message as escamillo when trying to add an image.
This is what this is plotting, 149.41 instead of 149.13.
http://screencast.com/t/4BjMysjLC1
Code: Select all
If LastBarOnChart_s then begin
value2 = high;
value1 = text_new(date, time, high,"");
text_setlocation(value1, date, time, high);
text_setstring(value1, text(value2));
text_setstyle(value1, 0, 2);
end;
This is what this is plotting, 149.41 instead of 149.13.
http://screencast.com/t/4BjMysjLC1
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Bonds settings
You are plotting Bar's High, which is 149 13/32 as can be seen on the screenshot.Something simple
This is what this is plotting, 149.41 instead of 149.13.
149 13/32=149.40625=rounded to 149.41
149.13 - where did you get this value from?
Try this code to get 4 digits after the decimal:
Code: Select all
If LastBarOnChart_s then begin
value2 = high;
value1 = text_new(date, time, high,"");
text_setlocation(value1, date, time, high);
text_setstring(value1, text(value2:1:4));
text_setstyle(value1, 0, 2);
end;
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
First I apologize, I should have written 149'13 and not 149.13.You are plotting Bar's High, which is 149 13/32 as can be seen on the screenshot.Something simple
This is what this is plotting, 149.41 instead of 149.13.
149 13/32=149.40625=rounded to 149.41
149.13 - where did you get this value from?
Try this code to get 4 digits after the decimal:Code: Select all
If LastBarOnChart_s then begin
value2 = high;
value1 = text_new(date, time, high,"");
text_setlocation(value1, date, time, high);
text_setstring(value1, text(value2:1:4));
text_setstyle(value1, 0, 2);
end;
When you trade bonds at what price do you execute your trades?
149'13 or 149.41?
http://screencast.com/t/1LTf9jAG
I know that the bar's high is 149 13/32, it's right there on the chart. The question should be why is MC converting fractions into decimals?
Tell me, how helpful is calling for the OHLC and as a result we get not the actual fraction but the decimal conversion.
See this image:
http://screencast.com/t/ECg3FvuD
Are you able to trade the ZB from those prices?
DayHigh - 149.97
So you decide to go long tomorrow above 149.97. Really?
Wouldn't be preferable when calling a bar's high, in this case the high for the day, we get 149'31 instead of 149.97? From these you are able to set an order to be triggered, NOT 149.97.
You must fix this ASAP.
I'm amazed that nobody complaint about this before. Probably no one trades bonds around here or the ones that do trade bonds are also programmers and were able to find a solution.
Why don't you create a function or something that users can use so when calling the OHLC we get the real fraction price and not a worthless decimal number?
I cannot believe that I'm not able to plot my main studies on bond charts because MC is converting fractions into decimals.
Check how MD handles fraction prices. They quote them as 149'13. When you call the high of a bar it is 149'13, NOT 149.97.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Something similar to this
Code: Select all
If LastBarOnChart_s then begin
value2 = high;
value1 = text_new(date, time, high,"");
text_setlocation(value1, date, time, high);
text_setstring(value1, numtostr(IntPortion(value2), 0) + "'" + NumToStr(FracPortion(value2) * 32, 1));
text_setstyle(value1, 0, 2);
end;
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
So I resolved one issue, converting all my strings to a realistic traded price.
Naturally that I was forced to create a second version of this indicator so it can translate the strings into fractions since I'm not capable of creating some function that would recognize if we are dealing with decimals or fractions so it could act accordingly.
Nevertheless, this must be fixed.
Key words, such as OHCL must be capable of retrieving the true prices in which instruments are trading. Converting a fraction quote into decimals when the actual traded price is in fractions is nonsense.
Naturally that I was forced to create a second version of this indicator so it can translate the strings into fractions since I'm not capable of creating some function that would recognize if we are dealing with decimals or fractions so it could act accordingly.
Nevertheless, this must be fixed.
Key words, such as OHCL must be capable of retrieving the true prices in which instruments are trading. Converting a fraction quote into decimals when the actual traded price is in fractions is nonsense.
- Attachments
-
- bond_str.png
- (47.66 KiB) Downloaded 2278 times
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Here's another example.
5 year DOM
Simplify that, just quote it as it's traded, 124'20.25, 124'20.50, 124'20.75, 124'21...
5 year DOM
Simplify that, just quote it as it's traded, 124'20.25, 124'20.50, 124'20.75, 124'21...
- Attachments
-
- bond_DOM.png
- (15.18 KiB) Downloaded 2400 times
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Yes, I'm using IB's settingsDOM settings are based on your QuoteManager settings. ZF is usually traded 128ths and not fractions of 32nds or 64ths.
- Attachments
-
- ib_set.png
- (20.79 KiB) Downloaded 2403 times
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Unfortunately, for that function to work properly on ZB I need to change the price scale of it on QM and doing that I mess up a couple of other studies I use.You could use the _NumToStr_Auto function for auto detection. Keep in mind that it works only if the root settings a correct. Sometimes the default settings in the QM for Min.Movement for the Bonds are wrong (5 instead of 1). Best is to double check the root settings in the Symbol Directory with the TS default settings.
Check the differences.
Using a price scale of 1/32 the _NumToStr_Auto function gives a correct reading but when using 1/32 and 10th of 32nd, which are the settings that IB and IQFeed uses, the result is the normal decimal conversion.
I cannot change that price scale because changing it, as I said, will mess up other studies. Maybe there's a way to change the function to work properly under that price scale. Unfortunately that task is beyond my knowledge.
- Attachments
-
- func02.png
- (26.06 KiB) Downloaded 2250 times
-
- func01.png
- (25.03 KiB) Downloaded 2249 times
Re: Bonds settings
I didnt change anything at the QM the last 2 years, on my settings i have set it at "1/32 and 10th of 32nd".
Dont know exactly what the difference between these 3 are, mabye Henry could clarify:
- "1/32 and S of 32nd".
- "1/32 and j of 32nd".
- "1/32 and 10th of32nd".
Dont know exactly what the difference between these 3 are, mabye Henry could clarify:
- "1/32 and S of 32nd".
- "1/32 and j of 32nd".
- "1/32 and 10th of32nd".
Last edited by SP on 11 Nov 2012, edited 2 times in total.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
IQFeed and IB have the following settings:Dont know exactly what the difference between these 3 are, mabye Henry could clarify:
- "1/32 and S of 32nd".
- "1/32 and j of 32nd".
- "1/32 and 10th of32nd".
- "1/32 and S of 32nd"
Used for the 10Y
- "1/32 and j of 32nd"
Used for the 5Y
- "1/32 and 10th of32nd"
Used for the 30Y
Since that function was designed for TS it than need to be updated to MC due to the different settings.
Anyone?
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Bonds settings
You have to match the Min. Movement with the Price Scale.
To find the correct settings, go to
Tools > Symbol Dictionary > Data Source: esignal
Double click on the Root you are searching for (eg. ZB) and copy that settings.
To find the correct settings, go to
Tools > Symbol Dictionary > Data Source: esignal
Double click on the Root you are searching for (eg. ZB) and copy that settings.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Yes TJ, the settings are the same.You have to match the Min. Movement with the Price Scale.
To find the correct settings, go to
Tools > Symbol Dictionary > Data Source: esignal
Double click on the Root you are searching for (eg. ZB) and copy that settings.
The function simply don't do its job using that setting "1/32 and 10th of32nd". It needs to be changed.
As I showed above, only with "1/32" setting the function is able to retrieve a correct fraction reading.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Sorry to say, but it doesn't.arnie,
the Min.Movement on the US on your first picture in post 16 shows 10 instead 1. That should solve your problem.
Using the code...
Code: Select all
If LastBarOnChart_s then begin
value2 = high;
value1 = text_new(date, time, high,"");
text_setlocation(value1, date, time, high);
text_setstring(value1, _numtostr_auto(value2));
text_setstyle(value1, 0, 2);
end;
Also, like I said, changing the original settings will mess up other studies, namely the ones that are calculating based on the high and low. I cannot change those settings.
There's 2 options, or that function is worked out or I maintain always 2 versions of the studies that are to be used on bonds and equities so I get correct fraction quotes, like I have at the moment:
The fraction version is not yet fully functioning since there's a couple of things to figure out...
- Attachments
-
- func07.png
- (36.75 KiB) Downloaded 2248 times
-
- func06.png
- (32.65 KiB) Downloaded 2238 times
-
- func05.png
- (31.47 KiB) Downloaded 2234 times
-
- func04.png
- (31.46 KiB) Downloaded 2236 times
-
- func03.png
- (30.72 KiB) Downloaded 2243 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Bonds settings [SOLVED]
Hello SP,Dont know exactly what the difference between these 3 are, mabye Henry could clarify:
- "1/32 and S of 32nd".
- "1/32 and j of 32nd".
- "1/32 and 10th of32nd".
Check the Price Scale information in the Setting Instrument Properties article.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Great work SP.arnie,
could you test if with this new function SP.AutoFormatPrice all prices are displayed properly for the Bonds?
As far as I can see, this function is working 100%.
Many thanks for your work. Hope this help many others that might be suffering from the way MC quote the treasuries.
- Attachments
-
- _US.png
- (31.62 KiB) Downloaded 2166 times
-
- _TY.png
- (33.85 KiB) Downloaded 2175 times
-
- _FV.png
- (43 KiB) Downloaded 2165 times
-
- _ES.png
- (33.01 KiB) Downloaded 2166 times
Re: Bonds settings
Since you piked this code from the TS forum, written and posted by Doug McCrary (DougM@TS) on November 8, you might at least have given credit to the code writer and origin. Better yet, don't pike code from the TS forum and post it here.
You could use the _NumToStr_Auto function for auto detection. Keep in mind that it works only if the root settings a correct. Sometimes the default settings in the QM for Min.Movement for the Bonds are wrong (5 instead of 1). Best is to double check the root settings in the Symbol Directory against the other vendor default settings.Naturally that I was forced to create a second version of this indicator so it can translate the strings into fractions since I'm not capable of creating some function that would recognize if we are dealing with decimals or fractions so it could act accordingly.
Code: Select all
{
Function: _NumToStr_Auto
Similar to the built-in NumToStr function, but automatically
determines if the symbol prices must be converted
to show 32nd, 64ths, 128ths ( Bond prices ), or are decimal based
and the number of decimals to display, such as 2 decimals for
regular stocks, and 4+ decimals for some Forex.
**** Uses the custom Decimals function created by goose. If you have
not already created this custom function then you will get a verification
error when attempting to verify this function.
Set this function to a String value Return Type on the General Tab.
}
inputs:
NumToConvert( numericsimple ) ;
variables:
Str1( "" ),
Symbol_Decimals ( Decimals( MinMove / PriceScale, 10 ) ) ;
// If the price scale is evenly divisible by 10 or is NOT evenly divisible by 32
// then use a decimal representation, else use a bond style representation with
// 32nds or 64ths shown using a quote (').
if Mod( PriceScale, 10 ) = 0 or PriceScale = 1 then
Str1 = NumToStr( NumToConvert, Symbol_Decimals )
// Grains, ...
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Really? Are we going to be picky over this?Since you piked this code from the TS forum, written and posted by Doug McCrary (DougM@TS) on November 8, you might at least have given credit to the code writer and origin. Better yet, don't pike code from the TS forum and post it here.
I also have the function written apparently by Doug McCrary(?) that a friend send me through email since I also don't have access to TS forum.
I did find odd the author didn't sign his name in the function code as programmers usually do, specially when they publish it on a public forum so all users might use it free of charge.
I believe SP did mention that the function was built for TS. If the author didn't sign his name how on earth can someone knows who wrote it? Do you really think that everyone has access to TS forum?
SP was kind enough to enhance the function so it can properly work over MC and this is his pay, someone bashing him, unbelievable...
Re: Bonds settings
By 'enhance' you mean that since the code was posted using methods it would not work in MC and he converted it to a function. Out of respect for TS and the TS Forums, a Public post of a TS reply for recently requested help on code is NOT OK. There is a healthy separation between the TS and the MC forums and it needs to stay that way. And, who posted the code will probably agree with me.SP was kind enough to enhance the function so it can properly work over MC and this is his pay, someone bashing him, unbelievable...
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Bonds settings
Well, you are one the the lucky ones that have access to both forums so more power to you who knows what is and is not posted there.By 'enhance' you mean that since the code was posted using methods it would not work in MC and he converted it to a function. Out of respect for TS and the TS Forums, a Public post of a TS reply for recently requested help on code is NOT OK. There is a healthy separation between the TS and the MC forums and it needs to stay that way. And, who posted the code will probably agree with me.SP was kind enough to enhance the function so it can properly work over MC and this is his pay, someone bashing him, unbelievable...
You are talking as if we knew what is happening there. If I knew I'd probably agree with you but since we have no idea of what is happening there you cannot come here and comment on the matter the way you did.
There's might be a healthy separation between the forums but what you just did was the opposite.