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 12-20-2005, 09:55 PM
Junior Member
 
Join Date: Dec 2005
Posts: 1
Vinni is on a distinguished road
Thanks!!!

Really very good lessons! Understandable and easy. Thank you very much, Codersguru!
I have a dream to make indicators for all Jap. candles, f.ex. "morning star" et.c. for buy and sell. If they work, why not to write indicators for them?
Maybe somebody already did that? I would be very very thankful if share with me..
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 12-31-2005, 07:15 AM
Junior Member
 
Join Date: Dec 2005
Posts: 5
FX4EVER is on a distinguished road
Bars - M1 random time scale.

Hi codersguru,

It is quite nice of you to put an effort and write all the lessons for all those who need extra the push to move forward. Here is my feedback on the subject of bars.

Following your explanation about the bars in ‘Bars.pdf’, I have checked time of many consecutive bars on M1 USDCAD chart. So far I was under the impression, that no matter what market is doing, I am going to see a bar every minute interval. I was expecting to see few consecutive bars with Open=High=Low=Close (taken from previous minute Close) and Vol=0 during slow (no ticks) market.

I was surprised that, bars are not evenly spaced in one minute intervals. It looks like the time difference between two consecutive bars is random and always longer than one minute.

I went through all the buttons in the application (MetaTrader) looking for some settings relevant to this phenomenon. I did not find anything that can influence time between the bars other than ‘Periodicity’ settings. Given the above, I wonder how one can evaluate charts where time scale in randomized.

Can you, please, comment on this phenomenon?

FX4EVER
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-18-2006, 08:04 PM
Junior Member
 
Join Date: Jan 2006
Posts: 1
pop71 is on a distinguished road
Thank u all, this real great work
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-19-2006, 07:12 AM
WRR WRR is offline
Member
 
Join Date: Nov 2005
Posts: 64
WRR is on a distinguished road
Bars vs. IndicatorCounted() and Coding Efficency

Quote:
Originally Posted by Techguy
Additional help for Bar referencing...

The Word document attached to the above referenced post states:

"int Bars

This internally updated variable returns the number of bars on the current chart, including the incomplete current bar. Bars is a reserved word and can be used in your code. It will reference the One Based numbering system count of all bars on the chart...

int IndicatorCounted()

This Function could be better thought of as the int Count_Of_Fully_Completed_Bars_Which_Are On_the_Chart ().
This function actually returns the bar count of fully completed bars that has not changed since the last time a quote was received, but does Not count the current uncompleted bar. In most cases, the same total count of index numbers will have not changed between individually received quotes and it is a big waste of time and effort for the program to recount the Bar array index every time the int Start () function is executed because a new quote has been received.

It has a return value in the int Start () of the total count of Bars - 1. The newest Bar is not counted if it is an incomplete bar and still in the process of forming. Until the new bar is complete, it will not be counted."

Techguy and codersguru,

After reading all this bar count stuff, me braaain 'urrts!!!

I have noticed very few mq4 files bother to use the IndicatorCounted() function. They use the Bars function instead, since one knows the number generated by Bars is the same as the number generated by IndicatorCounted() -1.

The phrase that caught my eye was "it is a big waste of time and effort for the program to recount the Bar array index every time the int Start () function is executed because a new quote has been received". What is actually going on with the workings of IndicatorCounted()? Does it count all the bars (except the current bar) only once when attached to the chart, then thereafter just increments the count immediately after each new bar is formed? Perhaps this should be clarified in the document.

What are some rules and guidelines for when to apply each of these functions assuming one is aware that they differ in value by one bar?

Similarly, while we are on the subject of coding efficency, it seems to me that many indicators only need to be drawn once, and may only need to be updated once a day or maybe once per bar (e.g. some pivot point programs).

What are some techniques for periodically updating the drawing of an object rather than updating it every tick? Can periodic updating also be applied to lines drawn with arrays?

Thank you both for efforts and contributions on this site.

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
  #15 (permalink)  
Old 02-19-2007, 02:47 AM
yudiwae's Avatar
Junior Member
 
Join Date: Jan 2007
Location: di kolong langit nan biru
Posts: 6
yudiwae is on a distinguished road
thanks for you all, Coderguru & techguy,

finally i know where i must started
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 02-19-2007, 04:03 AM
Senior Member
 
Join Date: Feb 2006
Posts: 1,211
et_phonehome_2 is on a distinguished road
Some good information. Can someone post all the functions available to EXCEL?
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 02-19-2007, 07:52 PM
Kurka Fund's Avatar
Senior Member
 
Join Date: Sep 2006
Location: San Diego
Posts: 138
Kurka Fund is on a distinguished road
Time in your bar

is there a way to calculate how much time is left in the formation of the current bar ?

for example.... 5 min chart

I know that i want to enter a position on the next bar if it reaches a certian price.

it that bar hit the target price within the first 30 seconds of opening, i know that there is a good probibilaty that I will be able to enter my position at an even better price.

How can I put some sort of countdown on the current bar formation?
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 09-04-2009, 09:51 PM
Junior Member
 
Join Date: Sep 2009
Posts: 3
WHRoeder is on a distinguished road
Quote:
Originally Posted by Kurka Fund View Post
is there a way to calculate how much time is left in the formation of the current bar ?
I believe I saw some code in MQL4 Articles: automated forex trading, strategy tester, expert advisors and custom indicatorsIt compared the date of the current bar vs date of a previous one to compute time remaining.
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 11-07-2009, 04:42 PM
Junior Member
 
Join Date: Sep 2009
Posts: 3
WHRoeder is on a distinguished road
Quote:
Originally Posted by WHRoeder View Post
I believe I saw some code in MQL4 Articles: automated forex trading, strategy tester, expert advisors and custom indicatorsIt compared the date of the current bar vs date of a previous one to compute time remaining.
int nextBar=Time[0]+Period()*60;
int secondsRemaining=nextBar-CurTime(); // negative values are possible
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


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
Close after 5 bars carllos Metatrader 4 3 05-15-2007 10:14 PM
Reversal Bars Foreverold Indicators - Metatrader 4 14 01-21-2007 12:23 AM
Day Bars Jonmem Setup Questions 2 12-12-2006 07:31 PM
Trouble with bars pabloschiki Metatrader 4 4 08-29-2006 09:09 PM
Appendix 2 - Trading functions codersguru Lessons 8 12-26-2005 02:46 PM


All times are GMT. The time now is 05:36 PM.



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