Bid and Ask Price / Size in indicator

Questions about MultiCharts and user contributed studies.
fibdax
Posts: 155
Joined: 03 Jan 2011
Has thanked: 10 times
Been thanked: 6 times

Bid and Ask Price / Size in indicator

Postby fibdax » 25 Oct 2019

Hi everyone I entered this code in an indicator to see if the bid and ask update works well and I notice that sometimes it doesn't coincide with the reality of things. If I insert the bid and ask field provided in the watchlist it is correctly updated while the indicator is not updated as shown in the images. Sometimes it coincides everything sometimes depends. What does this behavior depend on?
thanks

Code: Select all

if c>=insideask then
begin
plot7(q_asksize,"AskSize",white);
plot6(insideask,"Ask",red);
plot5(c,"CAsk",red);
plot4(0,"CBid",green);
plot3(insidebid,"Bid",darkgreen);
plot2(q_bidsize,"BidSize",white);

end;
if c<=insidebid then
begin
plot7(q_asksize,"AskSize",white);
plot6(insideask,"Ask",red);
plot5(0,"CAsk",red);
plot4(c,"CBid",green);
plot3(insidebid,"Bid",darkgreen);
plot2(q_bidsize,"BidSize",white);

end;
Attachments
Image.jpg
(16.51 KiB) Downloaded 116 times
Image2.jpg
(15.36 KiB) Downloaded 116 times
Image3.jpg
(29.24 KiB) Downloaded 116 times

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: Bid and Ask Price / Size in indicator

Postby Anna MultiCharts » 25 Oct 2019

Hello, fibdax!

Ask and Bid fields that are supplied from the data feed to the scanner directly are updated on their own. Your indicator is waiting for the data series with the selected quote field (Format instrument -> Settings -> Quote Field) to be updated so that the next calculation could be performed on the new data. When the indicator is calculated it reads the most current ask and bid values that are available at that moment. As far as Ask, Bid and Trade are not updated at the same time, there can be discrepancies between your indicator and native scanner Ask and Bid fields.
Also you should keep in mind that it also takes time for the indicator to be calculated, so the difference between the values can also be explained by this slight lag.

fibdax
Posts: 155
Joined: 03 Jan 2011
Has thanked: 10 times
Been thanked: 6 times

Re: Bid and Ask Price / Size in indicator

Postby fibdax » 25 Oct 2019

I imagined something like that. Is there no way to have an update like the bid and ask provided by the feed via code?
thanks

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: Bid and Ask Price / Size in indicator

Postby Anna MultiCharts » 29 Oct 2019

fibdax,

Unfortunately there’s no way you can achieve it from the code. Your indicator will only be calculated upon the updates of your main data series.


Return to “MultiCharts”