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
  #161 (permalink)  
Old 10-10-2006, 04:01 PM
Junior Member
 
Join Date: Aug 2006
Posts: 21
knili is on a distinguished road
Still the same results. However as I said before, it works for "Custome Indicators" but not for "Expert Advisors"
Here is the new code

#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int bar = 0;

int init()
{

return(0);
}

int deinit()
{
return(0);
}

int start()
{
if(Bars > bar)
{
bar = Bars;
Alert(High[1]);
Alert("Bars = " + Bars);
}
return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #162 (permalink)  
Old 10-12-2006, 02:19 AM
Senior Member
 
Join Date: Mar 2006
Posts: 787
Maji is on a distinguished road
mmf,

why do you think that it will be a profitable system? Do you have manual backtest results? I think this will kill an account.

From looking at the code, I think Solar Wind repaints the past.
Maji

Last edited by Maji; 10-12-2006 at 04:20 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #163 (permalink)  
Old 10-12-2006, 04:35 AM
mmf mmf is offline
Junior Member
 
Join Date: Jun 2006
Posts: 9
mmf is on a distinguished road
I read THAT code I can`t understand the way it works but follow me through the index found that changed its signs and i found the solution to that>
do at the 0.2 level and the level at the 0.2-and in contact with the positive and buying in contact with the negative sale.

Last edited by mmf; 10-12-2006 at 04:37 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #164 (permalink)  
Old 10-17-2006, 02:01 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 986
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Cool

Quote:
Originally Posted by BaasHarm
Hi guys,

I've been following this forum for a while now and picked up a lot of valuable lessons already. Especially thanks to Coder Guru for the quickstart to MQL4.

I'm managed to build a few simple EA's just to get familar with MT4. Now I want to start a new project but I got stuck.

I want to enter a trade after a 10 pip move, not based on any indicator, just on the tick data, if price moves up 10 pips (eventually with a time limit), I want to enter long and and if it moves down, go short. I don't want to use the bar open or close as this may be late or miss some big moves. What I need is how to "freeze" the starting price to compare to the bid/ask to see when the condition is met.

Any suggestions?
Why don't you use pending orders? They are very similar to your idea!
http://www.metatrader.info/node/80
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #165 (permalink)  
Old 12-01-2006, 09:30 AM
Member
 
Join Date: Aug 2006
Location: singapore
Posts: 40
eooojj is on a distinguished road
Help needed - How to code MQL MT4 for Breakeven after "x" pips?

Hi,
Thanks in advance.
Does anyone know the code MQL MT4 to incorporate a
Breakeven after profit has cross "x" pips?
Thanks thanks thanks.
ed

Last edited by eooojj; 12-02-2006 at 03:25 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #166 (permalink)  
Old 12-11-2006, 08:16 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Piece of code that should work

This little piece of code is looking to give the % change of the current bar as compared to the daily bar open. I don't know why it won't work...I can get it to output AmtChange and also O (which is the open) and the numbers given are correct. However when I combine them into the line (AmtChange/O)/*100 the code does not output anything. If anyone can find my problem please point it out to me before I pull my hair out!!!

int start()
{
i = Bars;
AmtChange = 0;
while(i >= 0)
{
if(i==Bars)
{
O=Open[i];
}
else
{
if(TimeDayOfWeek(Time[i])!=TimeDayOfWeek(Time[i+1]))
{
NO=Open[i];
O=NO;
}
}
AmtChange = Close[i] - O;
DayPctChange[i] = (AmtChange/O)*100;
i--;

}
return(0);
}

Thank you.

BW
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #167 (permalink)  
Old 12-11-2006, 08:17 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
I just wanted to add that I was writing a correlation indicator last week that exhibited similar behavior...I checked every number going into the final calculation, but for some reason it was not outputting anything. Is there some kind of syntax violation I'm repeatedly committing? Again, thanks for any help offered.

BW
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #168 (permalink)  
Old 12-12-2006, 01:48 AM
Senior Member
 
Join Date: Feb 2006
Posts: 559
Michel is on a distinguished road
Quote:
Originally Posted by bwilhite
I just wanted to add that I was writing a correlation indicator last week that exhibited similar behavior...I checked every number going into the final calculation, but for some reason it was not outputting anything. Is there some kind of syntax violation I'm repeatedly committing? Again, thanks for any help offered.

BW
It's possible that there is some error in the declaration of variables / buffers, so post the full indic here. Otherwise, check first if O != 0, because it can happen that a bar is missing or for whatever reason Open[i] = 0, then the whole indic stucs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #169 (permalink)  
Old 12-12-2006, 12:21 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Quote:
Originally Posted by Michel
It's possible that there is some error in the declaration of variables / buffers, so post the full indic here. Otherwise, check first if O != 0, because it can happen that a bar is missing or for whatever reason Open[i] = 0, then the whole indic stucs.
I'll check this first and then post the indicator. I don't think the problem is in the declarations. Thanks for the reply.

BW
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #170 (permalink)  
Old 12-12-2006, 12:29 PM
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Michel,

Thank you very much for taking the time to look at the code and reply. Sometimes all it takes is another pair of eyes! You were right that the error was division by 0 with a missing bar. All taken care of now.

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

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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 07: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 05:22 PM


All times are GMT. The time now is 12:24 PM.



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