| 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 | Thread Tools | Display Modes |
|
|||
|
Programming Question...
Hi. Could anyone tell me if it's possible to have Histograms oscillating about a value other than zero or is this another MT4 limitation. The 'SetLevelValue' command only seems to effect where the center line is drawn which is not the same thing...
|
|
||||
|
Quote:
![]()
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
|
|||
|
Quote:
![]() |
|
|||
|
A workaround would be to subtract your offset from the computed value before displaying the histogram. Say you want values above 60 to display positive, and values below 60 to display negative. Just subtract 60 from each of the values loaded into the display buffer, and they will display as you want, but you will mentally have to add 60 to each of the values when looking at the histogram.
|
|
|||
|
Quote:
|
|
|||
|
Omlette, perhaps I misunderstand the question? A histogram normally displays positive values above the zero line and negative values below the zero line. So you can force positive values below any arbitrary threshold to be negative. For example, if you want values below 60 to be displayed below the zero line, you can change the following line of code
MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i); to this: MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i) -60; It's a workaround, because when you look at the histogram, you mentally have to add 60 to the values displayed. For example, a value displayed as -20 is really +40, but you wanted it displayed below the zero line. |
|
|||
|
Hi. I know what you are saying but that is not was I was referring to. What I was trying to do was place two Histos in the same separate window, each occupying half that window. What I quickly found was that MT4 forces all histos to the infernal zero line irrespective of what offsets you use - you can offset above or below the zero but the colours will still 'run' to the zero line. For a sec. I thought the solution would be provided by the 'SetLevelValue' but this just sets where the line graphic is displayed. All this would be much easier to explain graphically, unfortunately that code formed the basis of a single histo indicator. You might consider try coding one yourself so you can see this limitation first-hand. It's a pity really 'cos you would think it would be relatively easy to add this feature.
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about programming AMA logic into an EA | zeroz | Metatrader 4 mql 4 - Development course | 4 | 12-09-2006 08:13 PM |
| Programming question using Close[] | knili | Metatrader 4 | 7 | 08-31-2006 07:35 PM |
| Indicator Programming Question | cubesteak | Indicators - Metatrader 4 | 5 | 08-05-2006 09:25 AM |
| a question on mt4 programming | huaxia009 | Metatrader 4 | 3 | 05-31-2006 03:10 AM |