| 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 (1) | Thread Tools | Display Modes |
|
|||
|
Can someone please explain to me what these lines of code mean/do:
Can someone please explain what these lines of code mean/do? :
SetIndexDrawBegin(0,BandsPeriod+BandsShift); SetIndexDrawBegin(1,BandsPeriod+BandsShift); SetIndexDrawBegin(2,BandsPeriod+BandsShift); SetIndexDrawBegin(3,BandsPeriod+BandsShift); |
|
|||
|
they do...
Quote:
hi, Suposse that you have an indicator with 4 lines. This code, says to the 4 lines where they have to start. THe 1st parameter is the line index or id (usually: from 0 to 9 . isīt correct?). The 2nd one is how many bars ago from current one must to start the line. Correct me if I wrong Good luck! |
|
|||
|
help with reading mql4 code for an indicator
I am trying to come up with a profitable strategy using this indicator--4 period ma. I used to trade live successfully using a similar indicator that I don't have access to anymore. I can't seem to find the optimal settings on 4pma i.e. ma length, method, etc.
Would anybody who can read MQL4 code be able to tell me how this indicator is constructed--how do you determine the hi and lo levels(they are the dynamic fibo levels), how do you determine the lcf and hcf levels? I understand the ma1, ma2, ma3 are moving averages, which lenght and method of calculation can be set by the user--ex. simple moving average, 13 period. It doesn't look like the default settings are optimal. That is why I am trying to understand how it works so that I can fix it. The indicator is attached below. Any help is appreciated. |
|
|||
|
Code Error?
Ive got an EA that doesnt seem to open Buy orders. Perhaps there is an error in the code????
//+------------------------------------------------------------------+ //| Open buy | | //+------------------------------------------------------------------+ if (!ExistPositions()){ if ((Ask < Op && Tenkan >= Kijun&&PrClose<Kijun/* &&BandUp4>BandUp12 */ )) /*Hi-Lo > LongBar*Point ex PRG /* PrClose>BandUp4&& PrClose>LWMA &&LWMA>LWMA20 /*&&BandUp4>BandUp12 */ { OpenBuy(); return(0); } Thanks in advance, Efextrader |
|
|||
|
Hello,
Does someone knows the/a code for compounding? I'd like to test when it's the best time to compound (per how many trades or days). Manually testing it is going to cost a lot of time I think (when you consider that I have some experts which make around a thousand trades per year).. And I thought/hoped the code shouldn't be too difficult... Thanks in advance, Paulan van Nes PS: I posted this also on another place, I don't know where it belongs.. (original topic: http://forum.mql4.com/3833) |
|
|||
|
Please, help me to understand custom indicator code
Hi. I am a newbie to MQL4. I noticed that many custom indicators contain the following lines to prepare for the bar-counting loop:
int counted_bars = IndicatorCounted(); if( counted_bars < 0 ) return(-1); if( counted_bars > 0 ) counted_bars--; int limit = Bars - counted_bars; for(int i=0; i<limit; i++) According to the tutorial from metatrader.info, counted_bars = IndicatorCounted() will calculate counted_bars as 0 at the first launch of the indicator. "After that it will be the count of total bars on the chart minus one". After what? After the first launch? Do I have to launch the indicator twice for it to work? The MQL4 reference manual is not much clearer either: "IndicatorCounted() returns bars count that does not changed after last indicator launch. In most cases same count of index values do not need for recalculation. Used for optimizing calculations." Then there is Bars, which is "the number of bars on the chart." Why not simpky use the following bar-counting loop: for(int i=1;i<=Bars;i++) I would understand if somebody can explain in the plain english what is exactly happening in int counted_bars = IndicatorCounted(); if( counted_bars < 0 ) return(-1); if( counted_bars > 0 ) counted_bars--; int limit = Bars - counted_bars; for(int i=0; i<limit; i++) and in what direction the bars are counted: forward (from the oldest bar to the newest) or backwards? Thanks in avdance! |
|
|||
![]() |
| Bookmarks |
| Tags |
| CHinGsMAroonCLK, I_XO_A_H |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
|
||||
| Posted By | For | Type | Date | |
| Need an experienced programmer? - Page 2 | Post #0 | Refback | 09-24-2008 06:24 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |