Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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
  #1 (permalink)  
Old 05-29-2006, 08:30 AM
Junior Member
 
Join Date: Mar 2006
Posts: 7
huaxia009 is on a distinguished road
a question on mt4 programming

void start
{
.......;
for i=1000, i>0, i--
{
a[m]=close[i];
m++;
}
.......;
.......;


}

in this example, will i calculate the "for" loop for 1000 times every time i receive new quotation? if so, how can i avoid it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-29-2006, 10:58 AM
Junior Member
 
Join Date: Jan 2006
Posts: 2
thorr is on a distinguished road
Quote:
Originally Posted by huaxia009
void start
{
.......;
for i=1000, i>0, i--
{
a[m]=close[i];
m++;
}
.......;
.......;


}

in this example, will i calculate the "for" loop for 1000 times every time i receive new quotation? if so, how can i avoid it?

int counted_bars=IndicatorCounted();
limit = Bars-counted_bars;
for(i=0;i<limit;i++) {
........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-30-2006, 12:05 AM
Junior Member
 
Join Date: Mar 2006
Posts: 7
huaxia009 is on a distinguished road
Quote:
Originally Posted by thorr
int counted_bars=IndicatorCounted();
limit = Bars-counted_bars;
for(i=0;i<limit;i++) {
........

thanks a lot.
but this method can also be used in expert advisor?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-31-2006, 03:10 AM
Junior Member
 
Join Date: Mar 2006
Posts: 7
huaxia009 is on a distinguished road
Quote:
Originally Posted by thorr
int counted_bars=IndicatorCounted();
limit = Bars-counted_bars;
for(i=0;i<limit;i++) {
........

i know how to do!
thanks very much!
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
Programming Question... omelette General Discussion 6 12-12-2006 02:29 AM
Question about programming AMA logic into an EA zeroz Metatrader 4 mql 4 - Development course 4 12-09-2006 08:13 PM
Programming question using Close[] knili Metatrader 4 7 08-31-2006 07:35 PM
Indicator Programming Question cubesteak Indicators - Metatrader 4 5 08-05-2006 09:25 AM


All times are GMT. The time now is 07:49 AM.



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