barenko:
You can compare the open price with close price :I need to get if the candle is green or red programatically. I already tried to use MqlRates and MarketBookGet to recover this info, but with no success.
Can you help me?
- close price > open price means green candle
- close price < open price means red candle
Sorry, I guess I misunderstood.
I understand that Red or green candle is determined as the Biantoro Kunarto commented and indicates the trades executed.
But what I need to determine is the volume of buyers and sellers in the order book at every tick.
I've tried using the official code example:
MqlBookInfo priceArray [];
Bool getBook = MarketBookGet (NULL, priceArray);
If (getBook)
{
Int size = ArraySize (priceArray);
Print ("MarketBookInfo for", Symbol ());
For (int i = 0; i <size; i ++)
{
Print (i + ":", priceArray [i] .price
+ "Volume =" + priceArray [i] .volume,
"Type =", priceArray [i] .type);
}
}
Else
{
Print ("Could not get contents of the symbol DOM", Symbol ());
}
But this code only returned "Could not get contents of the symbol DOM EURUSD".
barenko:
MqlBookInfo priceArray [];
Bool getBook = MarketBookGet (NULL, priceArray);
If (getBook)
{
Int size = ArraySize (priceArray);
Print ("MarketBookInfo for", Symbol ());
For (int i = 0; i <size; i ++)
{
Print (i + ":", priceArray [i] .price
+ "Volume =" + priceArray [i] .volume,
"Type =", priceArray [i] .type);
}
}
Else
{
Print ("Could not get contents of the symbol DOM", Symbol ());
}
Is the DOM available on your broker/symbol ? If yes, did you "enable" it ?
Sorry, I guess I misunderstood.
I understand that Red or green candle is determined as the Biantoro Kunarto commented and indicates the trades executed.
But what I need to determine is the volume of buyers and sellers in the order book at every tick.
I've tried using the official code example:
MqlBookInfo priceArray [];
Bool getBook = MarketBookGet (NULL, priceArray);
If (getBook)
{
Int size = ArraySize (priceArray);
Print ("MarketBookInfo for", Symbol ());
For (int i = 0; i <size; i ++)
{
Print (i + ":", priceArray [i] .price
+ "Volume =" + priceArray [i] .volume,
"Type =", priceArray [i] .type);
}
}
Else
{
Print ("Could not get contents of the symbol DOM", Symbol ());
}
But this code only returned "Could not get contents of the symbol DOM EURUSD".
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I need to get if the candle is green or red programatically. I already tried to use MqlRates and MarketBookGet to recover this info, but with no success.
Can you help me?