string GV_name = "Read_csv"; //Global Variable Name //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- if (GlobalVariableGet(GV_name) <= 0.0) { //Read csv file here GlobalVariableSet(GV_name, 1.0); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { GlobalVariableSet(GV_name, -1.0); } //+------------------------------------------------------------------+
Naguisa Unada:
Thank you for your help...BUT new problem occured !!!
I read CSV and save its data in a two dimensional dynamic string array......every time OnInit runs (or time frame changed) , this array get cleared and filled by random data .....is it possible to save two dimensional string array in global variables too?
Thanks.
You want to read and write CSV files only once when you start your program, don't you?
Then there should be no problem with the program I showed you.
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
Hi all
I have implemented reading .CSV file code in OnInit() function ....every thing is OK ...BUT every time that i chang chart's TimeFrame , the OnInit() runs again ...!!!!
How can i Read my .CSV file just Once ??? is it possible at all ?
Thanks in advanced.
Kind Regards.