Candle sticks with custom data ?

 
I was wondering if there is a way to draw candlesticks or bars from custom data like csv file or API feed ?

I know there 2 ways to draw them using histogram like heikenashi candles indicator , or drawing small trend lines with thicker width from open to close price  and trend line with thinner width from high to low  but thats not what I am looking for exactly 


My use case :
I want to draw candlesticks for the stocks that aren't provided by most of the brokers ( and I haven't find any broker who provide those stocks with mt4)
And I want to actually run some analysis using my indicators on those stocks , so I kinda need to manipulate the existing bars/candle sticks to be drawn on custom OHLC data

So is there a way to achieve something like this in mt4 ?  Or am I just pushing it ?

Thank you  
 
arads237: I was wondering if there is a way to draw candlesticks or bars from custom data like csv file or API feed? ... I want to draw candlesticks for the stocks that aren't provided by most of the brokers ( and I haven't find any broker who provide those stocks with mt4) And I want to actually run some analysis using my indicators on those stocks , so I kinda need to manipulate the existing bars/candle sticks to be drawn on custom OHLC data. So is there a way to achieve something like this in mt4 ?  Or am I just pushing it ?

On MT4 you can use Offline Charts for displaying OHLC data of other symbols and assets.

On MT5 you can use the Custom Symbols for the equivalent purpose.

 
Fernando Carreiro:

On MT4 you can use Offline Charts for displaying OHLC data of other symbols and assets.

On MT5 you can use the Custom Symbols for the equivalent purpose.

Thank you for your response , but can the offline charts be displayed using custom OHLC data from csv or some similar source ?
 
arads237: Thank you for your response , but can the offline charts be displayed using custom OHLC data from csv or some similar source ?

Did I not just say that the exact purpose of Offline Charts is to display OHLC data from other symbols?

Us the FileOpenHistory() function to produce the Offline Charts. Study the "PeriodConverter.mq4" file for more details and do a search on the site as well. The following thread should also help ...

Forum on trading, automated trading systems and testing trading strategies

.hst file format . . . Old and New (Jan 2014)

Simon Gniadkowski, 2014.01.29 22:51

For clarity for myself, at least, and anyone else that has an interest . . .

.hst file format valid as of MT4 Build 509

The database header first . . . total 148 bytes

int version; // database version - 400 4 bytes
string copyright[64]; // copyright info 64 bytes
string symbol[12]; // symbol name 12 bytes
int period; // symbol timeframe 4 bytes
int digits; // the amount of digits after decimal point 4 bytes
datetime timesign; // timesign of the database creation 4 bytes
datetime last_sync; // the last synchronization time 4 bytes
int unused[13]; // to be used in future 52 bytes


then the bars array (single-byte justification) . . . total 44 bytes

datetime ctm; // bar start time 4 bytes
double open; // open price 8 bytes
double low; // lowest price 8 bytes
double high; // highest price 8 bytes
double close; // close price 8 bytes
double volume; // tick count 8 bytes



.hst file format valid as of MT4 574 and later

The database header is the same . . . total 148 bytes

int version; // database version - 401 4 bytes
string copyright[64]; // copyright info 64 bytes
string symbol[12]; // symbol name 12 bytes
int period; // symbol timeframe 4 bytes
int digits; // the amount of digits after decimal point 4 bytes
datetime timesign; // timesign of the database creation 4 bytes
datetime last_sync; // the last synchronization time 4 bytes
int unused[13]; // to be used in future 52 bytes


then the bars array (single-byte justification) . . . total 60 bytes

datetime ctm; // bar start time 8 bytes
double open; // open price 8 bytes
double high; // highest price 8 bytes
double low; // lowest price 8 bytes
double close; // close price 8 bytes
long volume; // tick count 8 bytes
int spread; // spread 4 bytes
long real_volume; // real volume 8 bytes

FileOpenHistory - File Functions - MQL4 Reference
FileOpenHistory - File Functions - MQL4 Reference
  • docs.mql4.com
FileOpenHistory - File Functions - MQL4 Reference