Get the index of volume bar

 

Hello everyone this is my first post. I just want to know if I could get the index of volume bar in mlq4

I also want to know how to get the candlestick above this volume bar. How do I get that?


For example, let's say current volume bar would be index 0


Thank you

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Order Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
 
aalrehn:

Hello everyone this is my first post. I just want to know if I could get the index of volume bar in mlq4

I also want to know how to get the candlestick above this volume bar. How do I get that?


For example, let's say current volume bar would be index 0


Thank you

It's all in the documentation

https://docs.mql4.com/series

Timeseries and Indicators Access - MQL4 Reference
Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
Timeseries and Indicators Access - MQL4 Reference
 
aalrehn: I also want to know how to get the candlestick above this volume bar. How do I get that?

There is no such thing as a volume bar. Each candlestick has time, open, high, low, close, and (tick) volume.

 
aalrehn:

let's suppose I am running a loop to see the tick value of volume for example

for (int i = 0; i<10; i++){
double x = Volume[i];
double y = Volume[i+1];

}

this would return the volume tick but I want to return the index of where it is so I can draw a line on candlestick associated with it. How would I do that?

I think you still don't get it... there is no Tick value of volume, there is only the number of ticks per candlestick, referred to as Tick Volume.

So it is a count of the number of prices (ticks) recieved during the bar, and nothing to do with the size of trades.

Right click a chart and enable Show Volumes,  the Tick Volume per candlestick will then be shown at the bottom of the chart.

To access this information it is as per the documentation I pointed you to yesterday.

This bit of code will get and print the Tick Volume for the last ten candlesticks, starting with the latest (index 0)

Regards

https://docs.mql4.com/series/copytickvolume

#property strict

void OnStart()
{
   long  TickVolume[10];
   int Copied = CopyTickVolume(_Symbol,0,0,10,TickVolume);
   
   
   int Count;
   for(Count=0; Count<10; Count++)
      Print(Count + " - " + TickVolume[Count]);
}
CopyTickVolume - Timeseries and Indicators Access - MQL4 Reference
CopyTickVolume - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
CopyTickVolume - Timeseries and Indicators Access - MQL4 Reference
 

Do not double post!!

I have deleted your duplicate topic.

Reason: