Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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

Reply
 
LinkBack (1) Thread Tools Display Modes
  #131 (permalink)  
Old 07-20-2006, 10:01 PM
Junior Member
 
Join Date: Jul 2006
Posts: 15
RJames5541 is on a distinguished road
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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #132 (permalink)  
Old 07-20-2006, 11:37 PM
Member
 
Join Date: Jun 2006
Location: Buenos Aires
Posts: 55
ignacio is on a distinguished road
they do...

Quote:
Originally Posted by RJames5541
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);

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #133 (permalink)  
Old 07-21-2006, 06:28 PM
Junior Member
 
Join Date: Jun 2006
Posts: 23
DaytrSuccess is on a distinguished road
very simple code (trailing stop) - need correction

suppressed - to basic - without interest - sorry

Last edited by DaytrSuccess; 08-12-2006 at 02:12 AM. Reason: resolved
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #134 (permalink)  
Old 07-25-2006, 10:12 PM
Senior Member
 
Join Date: Jun 2006
Posts: 314
mpower is on a distinguished road
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.
Attached Files
File Type: mq4 4_Period_MA.mq4 (46.6 KB, 35 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #135 (permalink)  
Old 07-25-2006, 11:18 PM
Junior Member
 
Join Date: Jun 2006
Posts: 20
efextrader is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #136 (permalink)  
Old 07-31-2006, 05:15 PM
Member
 
Join Date: Apr 2006
Posts: 54
hidethereal is on a distinguished road
code to not paint the past...

Can someone fix this indicator so that it doesn't paint the past?


Thanks in advance!
Attached Files
File Type: mq4 #00_ZZ_Window.mq4 (7.1 KB, 30 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #137 (permalink)  
Old 08-05-2006, 04:58 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Smile

You need to have a professional programmer handle this EA. I recommend Yaroslav at Forex-Experts.com.

Dave
<><<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #138 (permalink)  
Old 08-22-2006, 11:58 AM
Junior Member
 
Join Date: Aug 2006
Posts: 11
paulan is on a distinguished road
Question Code/script for compouding

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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #139 (permalink)  
Old 09-03-2006, 06:40 PM
Junior Member
 
Join Date: Aug 2006
Posts: 6
fiqe8j4 is on a distinguished road
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #140 (permalink)  
Old 09-03-2006, 07:13 PM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
See if this article helps.

http://articles.mql4.com/45

good luck.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
CHinGsMAroonCLK, I_XO_A_H

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

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


All times are GMT. The time now is 07:28 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.