[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 156
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 don't understand, are you testing us all here?
If there's a problem, describe it.
Why would I do that? I'm asking a question, is it really necessary to troll for an answer?
The question is: how do you search for minutes within a high timeframe and get information about their (minutes') opening price?
Ask the question correctly.
Will give you an answer.
Since you have taken the initiative, let's try to come up with a code that would signal us every minute with information about the opening price of a one-minute candle on a five-minute chart (with the possibility of working in a tester). I propose my own variant:
This option is better.
Thank you.
Help me to understand. I build the MACD on the previous bar (i+1). I find max and min values visible in the MACD chart window. I put in Comment max, min and current values of the main and signal lines. Can someone help me figure it out.
#property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red #property indicator_width1 2 //--- buffers double Macd1Buffer[]; double Signal1Buffer[]; //--- for one bar datetime last; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Macd1Buffer); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Signal1Buffer); IndicatorDigits(Digits+1); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- Comment(""); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { if(last>=Time[0]) return; double max_M1=-0.01,min_M1=0.01, max_S1=-0.01,min_S1=0.01, max1=-0.01,min1=0.01; int bars_counted=WindowBarsPerChart()-1, limit; limit=bars_counted; //---- macd counted in the 1-st buffer for( int i=0; i<limit; i++) { Macd1Buffer[i]=iMA(NULL,0,6,0,MODE_EMA,PRICE_CLOSE,i+1)-iMA(NULL,0,12,0,MODE_EMA,PRICE_CLOSE,i+1); max_M1=MathMax(Macd1Buffer[i],max_M1); min_M1=MathMin(Macd1Buffer[i],min_M1); } //---- macd counted in the 2-nd buffer for( i=0; i<limit; i++) { Signal1Buffer[i]=iMAOnArray(Macd1Buffer,Bars,5,0,MODE_SMA,i); max_S1=MathMax(Signal1Buffer[i],max_S1); min_S1=MathMin(Signal1Buffer[i],min_S1); } max1=MathMax(max_M1,max_S1); min1=MathMin(min_M1,min_S1); Comment( "\n"," Баров = ",WindowBarsPerChart()-1, "\n"," max1 = ",max1, "\n"," min1 = ",min1, "\n"," Macd1Buffer = ",Macd1Buffer[i], "\n"," Signal1Buffer = ",Signal1Buffer[i]); last=Time[0]; //---- return(0); } //+------------------------------------------------------------------+Help me to understand. I build the MACD on the previous bar (i+1). I find max and min values visible in the MACD chart window. I put in Comment max, min and current values of the main and signal lines. Can someone help me figure it out.
The data type double is printed with 4 decimal digits after the point. To output numbers with greater precision, you must use the DoubleToStr() function.
Example:
Data of type double is output with 4 decimal digits after the point. To output numbers with higher precision, use the DoubleToStr() function.