Page 1 of 1

Spread in forex

Posted: 13 Oct 2011
by musuk
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.

Re: spread in forex

Posted: 13 Oct 2011
by TJ
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?

Re: spread in forex

Posted: 14 Oct 2011
by JoshM
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

Re: spread in forex

Posted: 14 Oct 2011
by musuk
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

Re: spread in forex

Posted: 14 Oct 2011
by JoshM
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

Re: spread in forex

Posted: 15 Oct 2011
by musuk
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.

Re: spread in forex

Posted: 15 Oct 2011
by TJ
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".

Re: spread in forex

Posted: 15 Oct 2011
by musuk
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

Re: spread in forex

Posted: 15 Oct 2011
by TJ
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

Re: spread in forex

Posted: 15 Oct 2011
by TJ
for spread-diff:

Image

Re: spread in forex

Posted: 15 Oct 2011
by musuk
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

Re: spread in forex

Posted: 15 Oct 2011
by TJ
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.

Re: spread in forex

Posted: 16 Oct 2011
by musuk
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

Re: spread in forex

Posted: 16 Oct 2011
by JoshM
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

Re: spread in forex

Posted: 16 Oct 2011
by musuk
ok that what i will do lets wait and see thanks to all of you

Re: spread in forex

Posted: 26 Oct 2011
by Trip
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;

Re: spread in forex

Posted: 26 Oct 2011
by JoshM
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