[color=blue]
// InsideAskBid
// Author: TUMS
// Date: 20081220
// Licence: Public use
// This program prints the Inside Ask and Inside Bid on the chart
// You may show the Bid/Ask as number or arrow
// This program work on the following charts: Hour, Minute, Second, Tick, Contract, Points(Range).
inputs:
ShowNumber(true),
Color(black),
size(10);
variables:
AskID(-1),
BidID(-1),
offset(0);
if bartype_ex = 2 then offset = barinterval * 100
else
if bartype_ex = 3 then offset = barinterval * 10000
else
if bartype_ex = 1 or bartype_ex = 8 or bartype_ex = 11 or bartype_ex = 13 then offset = 1
else
offset = barinterval;
if currentbar = 1 then
begin
AskID = Text_New_s(date,time_s, InsideAsk, NumToStr(insideAsk,2));
BidID = Text_New_s(date,time_s, InsideBid, NumToStr(insideBid,2));
end;
if ShowNumber then
begin
Text_setstring(AskID, NumToStr(insideAsk,2));
text_setcolor(AskID, Color);
text_setstyle(AskID, 0, 1);
text_setsize(AskID, size);
Text_setlocation_s(AskID, date,time_s + offset, InsideAsk);
Text_setstring(BidID, NumToStr(insideBid,2));
text_setcolor(BidID, Color);
text_setstyle(BidID, 0, 0);
text_setsize(BidID, size);
Text_setlocation_s(BidID, date,time_s + offset, InsideBid);
end
else
begin
Text_setstring(AskID, "<");
text_setcolor(AskID, Color);
text_setstyle(AskID, 0, 2);
text_setsize(AskID, size);
Text_setlocation_s(AskID, date,time_s + offset, InsideAsk );
Text_setstring(BidID, "<");
text_setcolor(BidID, Color);
text_setstyle(BidID, 0, 2);
text_setsize(BidID, size);
Text_setlocation_s(BidID, date,time_s + offset, InsideBid );
end;
[/color]