Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Lessons
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 01-19-2006, 06:11 AM
WRR WRR is offline
Member
 
Join Date: Nov 2005
Posts: 64
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #12 (permalink)  
Old 01-25-2006, 07: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #13 (permalink)  
Old 01-25-2006, 09: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 10:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #14 (permalink)  
Old 01-25-2006, 10: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #15 (permalink)  
Old 01-25-2006, 10: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 10:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #16 (permalink)  
Old 03-21-2006, 01: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 02:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #17 (permalink)  
Old 03-19-2008, 04: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #18 (permalink)  
Old 03-19-2008, 04: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #19 (permalink)  
Old 03-31-2008, 01:04 AM
heartnet's Avatar
Senior Member
 
Join Date: Mar 2008
Posts: 234
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #20 (permalink)  
Old 03-31-2008, 01:51 AM
Senior Member
 
Join Date: Jun 2006
Posts: 1,512
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
lesson


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 8 09-04-2009 08:58 PM
Lesson 2 - SYNTAX codersguru Lessons 12 08-08-2009 03:08 AM
Lesson 10 - Your First Indicator (Part1) codersguru Lessons 3 04-21-2009 03:52 AM
Lesson 17 - Your First Script codersguru Metatrader 4 mql 4 - Development course 0 01-05-2006 12:37 AM
Lesson 11 - Your First Indicator (Part2) codersguru Lessons 8 12-30-2005 03:20 PM


All times are GMT. The time now is 11:23 PM.



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