GET SIZE OF BID AND ASK LEVEL2
I used LEVEL2 to get a total of bids anda asks.
Level2 quote = quotes[i];
double size = quote.Size.
I would like obtain a total of Bids and Asks. How I can get its separeted ? I need % between Bids and Asks ...
Instrument inst = Instruments.Current;
Level2[] ask_level2 = inst.getAsksDepth();
double totalAsk = 0;
for (int i = 0; ask_level2.Length - 1 > i; i++)
{
totalAsk = totalAsk + ask_level2[i].Size;
}
Level2[] bid_level2 = inst.getBidsDepth();
double totalBid = 0;
for (int i = 0; bid_level2.Length - 1 > i; i++)
{
totalBid = totalBid + bid_level2[i].Size;
}
double Ask_percentual = (totalAsk / (totalBid + totalAsk))*100;
double Bid_percentual = (totalBid / (totalBid + totalAsk))*100;
string text_Ask_percentual = String.Format("{0:N2}", (Ask_percentual);
string text_Bid_percentual = String.Format("{0:N2}", (Bid_percentual);
Print("Total------------" + totalBid + " ( " + text_Bid_percentual + " %) ---- " + totalAsk + " ( " + text_Ask_percentual + " %)");
Good look !!
PS : I suggest putting (%) of total offers in Scalper mode and/or Matrix