Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 970

 
AlexeyVik:

Right... I didn't look carefully. Add another line.

It worked.

Thank you very much. ))

 

Hello. I'm asking for help with a probably elementary question. I want to write a multi timeframe EA based on 3 Elder windows. I need to get candlestick parameters on different timeframes. I have looked through Expert Advisors in kodobase but did not find anything suitable. I decided to write one myself. I have written it as I thought it would be right, but the program does not work.

I was struggling for a couple of days and got no results. Please help me with this piece of the program and advise me where the error is and how to make this place in the board correctly.

//===============================================================================

double Close_buf[20], Open_buf[20], High_buf[20], Low_buf[20]; //base arrays for candle parameters

datetime Time_buf[20]; //base array of bar open time

double close[2][20], open[2][20], high[2][20], low[2][20]; //arrays for candlestick parameters: number of bar is timeframe number,

//and the columns are the values of the bar parameter with the column number

datetime time[2][20]; // array of bar open time

int tf; // variable for the timeframe number

int i;

int OnInit()

{

//---

//--

return(INIT_SUCCEEDED);

}


//+------------------------------------------------------------------+

//| Expert deinitialization function |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

{

//---

ArrayFree(Time_buf);

ArrayFree(Close_buf);

//---

}

//+------------------------------------------------------------------+

//| Expert tick function |

//+------------------------------------------------------------------+

void OnTick()

{

//---

ArraySetAsSeries(Close_buf, true); //set indexing for the array Close_buf as in the time series

ArraySetAsSeries(Time_buf, true); //set indexing for the Time_buf array as in the timeseries

for( tf=0; tf<=1; tf++ ) // this loop on the M1, M5 timeframes,

{

if( tf==0 )

{

CopyTime("EURUSD",PERIOD_M1,0,20,Time_buf); // copy historical data time for each bar into the buffer

CopyClose("EURUSD" , PERIOD_M1,0,20,Close_buf); // copy historical data close for each bar

}

if( tf==1 )

{

CopyTime("EURUSD",PERIOD_M5,0,20,time_buf); // copy historical data time for each bar to the buffer

CopyClose("EURUSD", PERIOD_M5,0,20,Close_buf); // copy historical data close for each bar

}

for( i==0; i<=19; i++ ) // this is a loop on the bars. Reloading of data

{

time[tf][i]= NormalizeDouble(Time_buf[i] , Digits ) ;

close[tf][i]= NormalizeDouble( Close_buf[i] , Digits );

}

} // end of timeframe loop

} // end of void OnTick()

 

A question for the programmers.

Withdrawn.

 
Can you tell me how to write the alerts produced by the indicator in a separate text document?
 
Alligator:

A question for the programmers.

Withdrawn.

Sorry, is my question withdrawn? If so, why?

 
boris.45:
)) No, I meant my question.
 

When ascript of the same typeis attached toa financial tool window, the window keeps popping up, do you really want to delete the script with the "name"?

Please advise how to get rid of this pop-up window.

 
korobok777:

When ascript of the same typeis attached toa financial tool window, the window keeps popping up, do you really want to delete the script with the "name"?

Please advise how to get rid of this pop-up window.

Only one script or Expert Advisor can be on the chart at a time. If you need to, open another chart with the same instrument and run there
 

Vinin:
Одновременно может быть на графике только один скрипт или советник.

If you need to, open another chart with the same tool and run it there

I wanted to make a script that will convert all open windows to a period specified in an external variable,

I'm trying to make a script that will convert all the windows open to the period specified by an external variable.

only annoying is the floating window, do you really want to delete the script with the "name" ?

if there is no solution THANK YOU!!!!

 
korobok777:
You can't tell without the code