Forex



Go Back   Forex Trading > Programming > MetaTrader
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
  #161 (permalink)  
Old 10-10-2006, 03:15 PM
Junior Member
 
Join Date: Aug 2006
Posts: 21
knili is on a distinguished road
Help with simple code

Hello all,
Got a very simple question
I have this code in Expert Advisors and doesn't work. Same code in Custome Indicators and works, any idea? I excuting this code against 1 min chart

Also I have declear bars as global int.

int start()
{
if(Bars != bars)
{
bars = Bars;
Alert(High[1]);
}
return(0);
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
  #162 (permalink)  
Old 10-10-2006, 03:17 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 722
Kalenzo is on a distinguished road
U initialized bars variable before start function - in global section?
Try to use if (Bars>bars)
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
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
  #163 (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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #164 (permalink)  
Old 10-12-2006, 02:19 AM
Senior Member
 
Join Date: Mar 2006
Posts: 793
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #165 (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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #166 (permalink)  
Old 10-17-2006, 02:01 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #167 (permalink)  
Old 12-01-2006, 09:30 AM
Member
 
Join Date: Aug 2006
Location: singapore
Posts: 39
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #168 (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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #169 (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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #170 (permalink)  
Old 12-12-2006, 01:48 AM
Senior Member
 
Join Date: Feb 2006
Posts: 587
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!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
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


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
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 09:29 AM.



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