Spread in forex

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Spread in forex

Postby musuk » 13 Oct 2011

hi i want to see the difference between the bid and ask price on the chart or any where on the multichart program and if possible i can add the fees for each trade.

thanks
p.s . i tried to use the indicator spread diff but it did not work.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: spread in forex

Postby TJ » 13 Oct 2011

hi i want to see the difference between the bid and ask price on the chart or any where on the multichart program and if possible i can add the fees for each trade.

thanks


p.s . i tried to use the indicator spread diff but it did not work.
how did you try it?

what data feed are you using?
what is the symbol?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: spread in forex

Postby JoshM » 14 Oct 2011

hi i want to see the difference between the bid and ask price on the chart or any where on the multichart program and if possible i can add the fees for each trade.

thanks
p.s . i tried to use the indicator spread diff but it did not work.
how did you try it?
This question from TJ is key. Look at what you want to achieve ("plot the difference between bid and ask price") and contrast that with the code of the default "Spread - Diff" indicator:

Code: Select all

inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ;

Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ;
Do you see the discrepancy, and how the "Spread - Diff" indicator might work given your objective? :) (Bonus points if you see why the "Spread - Diff" indicator is not suited for your objective)

Regards,
Josh

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 14 Oct 2011

thanks for ur replay

well am trying to get the spread the cost of each time ibuy or sale
am using mbt uk as a broker and data feed for forex
am tryingto see eur/usd when i use the indcator spread diff it tell me data is missing as i think it need 2 data to get the diffrent.
ihope its clear now.

thanks

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: spread in forex

Postby JoshM » 14 Oct 2011

am tryingto see eur/usd when i use the indcator spread diff it tell me data is missing as i think it need 2 data to get the diffrent.
Yes, that's correct. The "Spread - Diff" indicator needs two data series applied to that chart. So if you add the Bid as data series one, and the Ask as data series two, you can calculate the (absolute) spread between them.

Btw, in your second post you want to achieve something different than you stated in your first post:
hi i want to see the difference between the bid and ask price on the chart or any where on the multichart program and if possible i can add the fees for each trade.
well am trying to get the spread the cost of each time ibuy or sale.
This difference is significant in terms of coding. In your first example, you'll be looking at an indicator that calculates the spread including commission from MB Trading. In the second example, you'll calculate the spread only when you have opened an position (added with the commission for that position?). And in this second example, you want to "get" the spread, which suggests to me that that is something different than plotting a value (i.e. where do you want to "put" that retrieved data?).

(Note that the commission for MB Trading is different depending on which order (limit or market) you use.)

To borrow a line from TJ :): do you have a flowchart? What do you want to achieve?

Regards,
Josh

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 15 Oct 2011

ok thanks for all ur replays

first i want to get the different in ask and bid price to know the cost without the commission from mbT i tried to use the spread diff and it want work i have one chart where it show only eur/usd and i have attached a pic of the data that i need to put do i ask in the data series 1 and bid in data series 2 it want work it say error can you please show me how am i missing something.

thanks

and about the fees in terms of market order i think i should learn that later on not now now i need to find out this thing as its really confusing.
Attachments
Capture.JPG
(62.09 KiB) Downloaded 1932 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: spread in forex

Postby TJ » 15 Oct 2011

ok thanks for all ur replays

first i want to get the different in ask and bid price to know the cost without the commission from mbT i tried to use the spread diff and it want work i have one chart where it show only eur/usd and i have attached a pic of the data that i need to put do i ask in the data series 1 and bid in data series 2 it want work it say error can you please show me how am i missing something.

thanks

and about the fees in terms of market order i think i should learn that later on not now now i need to find out this thing as its really confusing.
Do you have the bid/ask quotes?
Can you plot a chart of bid only? and a chart of ask only?


ps. to speed up the replies, please provide as much information as possible. You should make screen shots of as many screens you have, including the chart that shows "nothing".

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 15 Oct 2011

ok now i think i know whats i need
is it that i need a bid chart and a ask chart and a trade chart and the trad chart will have the spread diff is correct or not and any way here is my chart that i thought just to show a price of the cost anywhere on the screen it doesn't matter as an indicator on the bottom or on top
Attachments
Capture.JPG
(265.3 KiB) Downloaded 1901 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: spread in forex

Postby TJ » 15 Oct 2011

ok now i think i know whats i need
is it that i need a bid chart and a ask chart and a trade chart and the trad chart will have the spread diff is correct or not and any way here is my chart that i thought just to show a price of the cost anywhere on the screen it doesn't matter as an indicator on the bottom or on top
you can select trade, bid, or ask for your chart

Image
Attachments
format instrument.gif
(19.38 KiB) Downloaded 2162 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: spread in forex

Postby TJ » 15 Oct 2011

for spread-diff:

Image
Attachments
InsideAsk InsideBid.gif
(12.75 KiB) Downloaded 2434 times

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 15 Oct 2011

ok thanks do you know why i cant get the ask prise as the bid is fine but for ask i get no data do you thing it got to do with the my broker as its my data feed is the same as my broker.

thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: spread in forex

Postby TJ » 15 Oct 2011

ok thanks do you know why i cant get the ask prise as the bid is fine but for ask i get no data do you thing it got to do with the my broker as its my data feed is the same as my broker.

thanks
It should not make a difference if your broker is also your datafeed.

are you looking at live data or data already saved in your computer?

please go to QuoteManager,
highlight your symbol,
from the Main menu, select EDIT > Fields to collect.
Make sure the bid and ask are selected.

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 16 Oct 2011

i did what u asked me to do i added all the tick minutes day for bid and ask
but its the same i get no data for ask only maybe i have to wait for tonight after 10pm london time when the market will start and then i can see the ask price.

dose any one know if mb trading they do provide ask price for forex .

one more thing

do you know what is the difference between the forex and fx exchange as i just realised that my eur/usd is on forex and gbp/usd is on fx exchange is there any big different?

thanks
Attachments
Capture.JPG
(132.31 KiB) Downloaded 1902 times

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: spread in forex

Postby JoshM » 16 Oct 2011

i did what u asked me to do i added all the tick minutes day for bid and ask
but its the same i get no data for ask only maybe i have to wait for tonight after 10pm london time when the market will start and then i can see the ask price.
That's correct, you'll see the saved bid/ask as soon as there is real-time data saved in the QuoteManager after you've changed these settings.
dose any one know if mb trading they do provide ask price for forex .
No, MB Trading does not provide historical ask data, but in real-time trading they (of course) show bid/ask prices, so the solution proposed by TJ should work.
do you know what is the difference between the forex and fx exchange as i just realised that my eur/usd is on forex and gbp/usd is on fx exchange is there any big different?
Don't know the exact difference, but probably something to do with Trading Hours, 'contract' specifications, and/or routing differences. According to MC support, the MB Trading symbols are added automatically to the FX exchange for order routing.

Regards,
Josh

musuk
Posts: 13
Joined: 05 Oct 2011
Has thanked: 7 times

Re: spread in forex

Postby musuk » 16 Oct 2011

ok that what i will do lets wait and see thanks to all of you

Trip
Posts: 8
Joined: 08 Mar 2011
Been thanked: 8 times

Re: spread in forex

Postby Trip » 26 Oct 2011

I use this code to display the spread on the market scanner.

Code: Select all

Input: Multi(1);

Value1 = Absvalue((Q_Bid - Q_Ask) * Multi);

if (Value1) > (Value1[1]) then
SetPlotColor(1, Green);
if (Value1) < (Value1[1]) then
SetPlotColor(1, Red);

Plot1( Value1, "Spread" ) ;
Multi input moves the decimal point the correct number of places to display the whole number.
Using DTN IQ with FXCM symbols EURUSD.FXCM multi = 10000. The Multi must be corrected for each symbol as it may be different.

I use this code to display the spread in the upper left corner of a chart.

Code: Select all

Input: DecPlaces(4), Multip(1), TxtSize(20);

variables:
n1(0), n2(0), intrabarpersist id(0), intrabarpersist del.id(False),OE(""),PosI(0),PColor(Red),PosII(0);


PosI = ((insideask - insidebid)* Multip);
PosII = absvalue(PosI);
OE = NumToStr(PosII,DecPlaces);

If PosI > PosI[1] Then PColor = green
else
If PosI < PosI[1] Then PColor = red;


if LastBarOnChart_s then begin

n1 = getappinfo(aiLeftDispDateTime);
n2 = (getappinfo(aiHighestDispValue) - getappinfo(aiLowestDispValue))*0.99 + getappinfo(aiLowestDispValue);
if del.id then text_delete(id);
del.id = False;
if barstatus = 2 and id > 0 then del.id = True; // delete label next tick
id = text_new_s(JulianToDate(n1), StrToNum(FormatTime("HHmmss",n1)), n2, OE );
Text_SetSize(id, TxtSize);
Text_SetStyle(id, 0, 2);
Text_SetColor(id, PColor);
Text_SetAttribute(id, 1, true);
end;

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: spread in forex

Postby JoshM » 26 Oct 2011

Thanks for sharing Trip. :)
Multi input moves the decimal point the correct number of places to display the whole number.
Using DTN IQ with FXCM symbols EURUSD.FXCM multi = 10000. The Multi must be corrected for each symbol as it may be different.
With some trail and error, I've coded that in my Market Scanner 'spread in ticks' indicator with..

Code: Select all

once begin
if category = 12 then
toTickValue = 1 / ( MinMove / (PriceScale*0.1) )
else
toTickValue = 1 / (MinMove / PriceScale);
end;

spread = (InsideBid - InsideAsk) * toTickValue;
(Where the '*0.1' is for fractional pips).

I'm not saying this is a better way, or the best way to calculate this - but perhaps it might be handy.

Regards,
Josh


Return to “User Contributed Studies and Indicator Library”