| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
|
|
LinkBack (2) | Thread Tools |
|
|
|||
|
|||
|
Well, here is another question as I continue to learn how to convert from MQL3 to MQL4....
I would like to paint a section of the chart which lies between two lines, upper and lower. I don't know if there is any function to paint a screen section or not, so I decided to try using the "Draw_Histogram" in the SetIndexStyle() statement. But, I don't quite understand how it works. When I use it, nothing happens. ex: SetIndexStyle(7,DRAW_HISTOGRAM,0,1); ExtMapBuffer8[cnt]= (Pivot_Point-(Short_Line*Point)); Print("Cnt = ",cnt," Histo = ",ExtMapBuffer8[cnt]," Calc = ",(Pivot_Point+(Short_Line*Point))); The output in the journal produces the proper cnt, the proper calc but the Histo value is zero. I have examined the code in the MACD indicator, to no avail, and in the Heiken-Ashi indicator, and I fail to understand how it works. The Heiken-Ashi indicator appears to use 4 buffers to create each candle, but I am not certain of that. The MACD appears to use a baseline of zero, from which the histogram bar is drawn, is there a baseline from which it starts? If so, how does one go about establishing it? Could someone please explain how this function works,so that I may learn how to code it properly. If there is a function that would paint a specified screen section, I would appreciate any info on that as well. Thank you all for your kind assistance.... Sincerely, Chief |
|
|
|||
|
|||
|
Well, some more work and I think I may have come to understand the "Draw_Histogram" portion of the SetIndexStyle() statement....
To draw a Histogram requires two points on the Y axis, an upper point and a lower point. The "Draw_Histogram" function utilizes the last 2 buffer outputs to obtain those points. It appears the 1st buffer is the beginning point on the Y axis and the 2nd buffer is the ending point on the Y axis. Here is an example: //--------------------------------------------------// SetIndexStyle(0,DRAW_LINE,2,1); SetIndexStyle(1,DRAW_LINE,0,2); SetIndexStyle(2,DRAW_LINE,0,2); SetIndexStyle(3,DRAW_HISTOGRAM,0,1); //---------------------------------------------------// SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); //---------------------------------------------------// ExtMapBuffer1[cnt]= Pivot_Point ; ExtMapBuffer2[cnt]= Pivot_Point+(Buy_Line*Point); // 1st Point ExtMapBuffer3[cnt]= Pivot_Point+(Short_Line*Point); //2nd Point ExtMapBuffer4[cnt]= (Pivot_Point+(Buy_Line*Point)); // Histogram output //---------------------------------------------------// The length of the Histogram line is the difference between these 2 buffer points. By altering the distance between these 2 points, the length of the Histogram line is altered as well. Hope I am correct in my deductions... If anyone has anything to add please do.. I would like to know that I fully understand this function. As well, hope this explanation might help someone else who is trying to utilize this function in their work. Sincerely, Chief ![]() |
|
|
|||
|
|||
|
Crosses question
I am trying to code multiple crosses as conditions to enter the market. Such as (for example)
if (rsi is crossing 50 on its way up and MFI is crossing 40 on its way up) { do xyz; } I know this should be simple but I am having trouble with it. Any assistance appreciated. Thanks in advance. Hal |
|
|
|||
|
|||
|
I'm totally new to programming EA's, but I do now C++ and mostly the two languages seem to be the same, I just need some information about things specific to MetaTrader -
Firstly, how would you check if the moving average passed between the open and close of the previous candle, I would like the program to do this everytime a new candle starts forming. So for this I would just like to know the following - is there a function that returns the position of the moving average? is there a function/s that returns the open and the close of the previous candlestick? also is there a function that returns the current market value? Secondly, what are the functions to buy and sell I would appreciate any answers that could be given to these questions and apologize if these have been answered before, as navigating and searhing forums has never been one of my strong points. ![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
|
|
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |