Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Lessons


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 Thread Tools Display Modes
  #11 (permalink)  
Old 01-19-2006, 05:11 AM
WRR WRR is offline
Member
 
Join Date: Nov 2005
Posts: 44
WRR is on a distinguished road
Thumbs up Thanks

codersguru,
thanks so much for all your work and sharing of your knowledge. I've read all the lessons you have created so far and they are very informative. Keep up the great work!
WRR
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 01-25-2006, 06:29 AM
Member
 
Join Date: Jan 2006
Posts: 51
blooms is on a distinguished road
I still have question with IndicatorCounted().

In the function start() which is executed everytime new tick is delieved (right?),
function counted_bars = IndicatorCounted() is executed, which means counted_bars is always Bars -1, after line counted_bars--, counted_bars will be equal to Bars - 2, so pos should be equal to 2. But it seems not. What is the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 01-25-2006, 08:51 PM
Member
 
Join Date: Jan 2006
Posts: 51
blooms is on a distinguished road
It really confirms my doubt.

I tested the values of counted_bars and Bars. The first time the function start() runs,Bars already a big number, but counted_bars is 0, so pos is a large number. After that, I found when new bar first appears,
the Bars increases by 1, the counted_bars keeps the same, so the pos is 3,
when the new tick is delievered, the pos will be 2 (Bars keeps the same, counted_bars increases by 1 but keeps the same later).

Now my question is:
Every time the new bar first appears, pos = 3, so the
ExtMapBuffer1[3], ExtMapBuffer1[2], ExtMapBuffer1[1], ExtMapBuffer1[0] will be updated, other ExtMapBuffer1 elements will keep the same.
What's the point for that???? Anybody bother to give me a hint? I hate to see the magic buried in the MQL4.

Last edited by blooms; 01-25-2006 at 09:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 01-25-2006, 09:14 PM
Member
 
Join Date: Jan 2006
Posts: 51
blooms is on a distinguished road
How does MQL4 deal with the buffer?

My guess is when Bars changes (it always increase by 1), the indicator value
for the new bar to be shown in the windows will be always ExtMapBuffer1[0], others will be rotated from low to high one-by-one???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 01-25-2006, 09:33 PM
Member
 
Join Date: Jan 2006
Posts: 51
blooms is on a distinguished road
The interesting thing that I found is when I remove the line

Code:
if(counted_bars > 0) counted_bars--;
The indicator still works pretty fine! So what's the point of adding the above line??? To tell you the truth, I even modify the above line to be

Code:
if(counted_bars > 0) counted_bars++;
and still get the indicator works perfectly fine. (In that case, pos is generally 0, and when new bar first appears, pos will be 1).

I think now I got the answer. All corrections are WELCOME!

Last edited by blooms; 01-25-2006 at 09:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 03-21-2006, 12:26 PM
BC Brett's Avatar
Member
 
Join Date: Mar 2006
Location: Vancouver, British Columbia
Posts: 33
BC Brett is on a distinguished road
Is it codersguru or pseudoguru?

I have to agree with you Blooms.
My take on this indicator is that on the first run through, when counted_bars==0, what it needs to do is assign ExtMapBuffer1[] with a value for each Bar so they can be displayed in the window. After the first run through, when counted_bars>0, only ExtMapBuffer1[0] needs to be updated for each tick. I rewrote the code and got the exact same indicator window display as codersguru's original indicator.

REPLACE:
int start()
{
int counted_bars=IndicatorCounted();
int pos=Bars-counted_bars;

//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;


double dHigh , dLow , dResult;
Comment("Hi! I'm here on the main chart windows!");

//---- main calculation loop

WITH:
int counted_bars , pos;
double dHigh , dLow , dResult;

int start()
{
counted_bars=IndicatorCounted();

if(counted_bars<0) return(-1);
if(counted_bars==0) pos=Bars-1;
if(counted_bars>0) pos=0;

//---- main calculation loop

Last edited by BC Brett; 03-21-2006 at 01:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 03-19-2008, 02:05 PM
Junior Member
 
Join Date: Mar 2008
Location: Romania, Bucharest
Posts: 2
lstoian is on a distinguished road
answers

Hi,

Is somene gone answer all these questions ?

I have some but I don't see any answers since 2006

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 03-19-2008, 02:08 PM
Junior Member
 
Join Date: Mar 2008
Location: Romania, Bucharest
Posts: 2
lstoian is on a distinguished road
IndicatorCounted ()

Hi,

How this function is called again and again.

In function start is called outside the loop meaning that only once it gives probably 0 value.

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 03-31-2008, 12:04 AM
heartnet's Avatar
Senior Member
 
Join Date: Mar 2008
Posts: 151
heartnet is on a distinguished road
Another Request...

codesguru how to add 2 indicator(same levels,different setting eg.stoch 5,3,3 and stoch 20,10,20) in a window?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 03-31-2008, 12:51 AM
Senior Member
 
Join Date: Jun 2006
Posts: 1,136
prasxz is on a distinguished road
hi

Quote:
Originally Posted by heartnet View Post
codesguru how to add 2 indicator(same levels,different setting eg.stoch 5,3,3 and stoch 20,10,20) in a window?
go to navigator , find stochastics then drag and drop to your chart ..do this once again for second stochastics indicator

===================
Forex Indicators Collection
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 9 - Preprocessors codersguru Lessons 7 05-18-2006 08:26 PM
Lesson 17 - Your First Script codersguru Metatrader 4 mql 4 - Development course 0 01-04-2006 11:37 PM
Lesson 11 - Your First Indicator (Part2) codersguru Lessons 8 12-30-2005 02:20 PM
Lesson 2 - SYNTAX codersguru Lessons 7 12-18-2005 12:57 PM
Lesson 10 - Your First Indicator (Part1) codersguru Lessons 1 11-08-2005 11:17 PM


All times are GMT. The time now is 10:38 PM.



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