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
  #301 (permalink)  
Old 08-20-2007, 05:30 PM
Junior Member
 
Join Date: Apr 2007
Posts: 6
phasna is on a distinguished road
EA will show trades in the popup window but...

I'm a newbie programmer. I've programmed an EA that will work in the strategy tester and will pop up a buy or sell window live. The problem is that no trades show up on the chart or in the account. Any ideas on why this might be happening?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #302 (permalink)  
Old 08-20-2007, 07:44 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
Quote:
Originally Posted by phasna View Post
I'm a newbie programmer. I've programmed an EA that will work in the strategy tester and will pop up a buy or sell window live. The problem is that no trades show up on the chart or in the account. Any ideas on why this might be happening?

Thanks
Hi. Well, if there are not trades shown in your account, it is obviously a problem with the trading logic - ie. it could be anything!

Apart from the obvious and posting the code for someone to look at, you should get an idea from the 'Journal' window during backtests as to why it is not opening trades (error messages).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #303 (permalink)  
Old 08-20-2007, 08:50 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Loading indicatordata into EA

Hi,
how can I get calculatet data of an indicator into an EA?
I have build those indicators:
Discret Butterworth-Lowpass-Filter (1st order)
I think one problem is, that one indicator creates 3 datafields (3 lines in chart-window). I need the current data and the shifted (one bar) data, too.
The indicator is called: butterworth-ad, so I tried the following to call it in an EA:
ibutterworth-ad(......), but that doesn´t work

Can someone help me?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #304 (permalink)  
Old 08-21-2007, 05:08 AM
Willis11of12's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 105
Willis11of12 is on a distinguished road
Quote:
Originally Posted by justize View Post
Hi,
how can I get calculatet data of an indicator into an EA?
I have build those indicators:
Discret Butterworth-Lowpass-Filter (1st order)
I think one problem is, that one indicator creates 3 datafields (3 lines in chart-window). I need the current data and the shifted (one bar) data, too.
The indicator is called: butterworth-ad, so I tried the following to call it in an EA:
ibutterworth-ad(......), but that doesn´t work

Can someone help me?
Hey Justize. If you are using a custom indicator you have to call it differently. try this:
iCustom(NULL,0,"butterworth-ad"......,0,0)
iCustom(NULL,0,"butterworth-ad"......,0,1)
The second one is for the previous bar. You can look up "iCustom" in the search box in your meta editor if you want to understand more about how to call custom made indicators in your EA. I hope that is what you were looking for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #305 (permalink)  
Old 08-21-2007, 07:19 AM
Junior Member
 
Join Date: Oct 2006
Posts: 1
guo007 is on a distinguished road
how to determine the current window is MT4?

this article is working to react users' commands
Get keyboard keys to MetaTrader! | www.metatrader.info

but if i press the key in other window, it still works, that makes some conflict, does anybody know how to make it filter other window's keyboard event?

i tried the following:
#include <WinUser32.mqh>

……

#import "user32.dll"
bool GetAsyncKeyState(int nVirtKey);
int GetForegroundWindow();
#import

……

int start()
{
string lpString1;
int nMaxCount1;
int hwa= GetForegroundWindow(); //this api works
nMaxCount1 = GetWindowTextLengthA(hwa); //this api works
int x = GetWindowTextA(hwa,lpString1,nMaxCount1); //it returns 0, lpString1 is null too here
if ( GetAsyncKeyState(VK_0))
Alert("0 pressed "+hwa+" "+nMaxCount1+" "+x+" "+lpString1);

}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #306 (permalink)  
Old 08-21-2007, 07:25 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Hi,
thank you very much, that i, what i need!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #307 (permalink)  
Old 08-21-2007, 07:27 AM
Willis11of12's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 105
Willis11of12 is on a distinguished road
You're welcome.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #308 (permalink)  
Old 08-21-2007, 04:22 PM
Junior Member
 
Join Date: Jan 2006
Posts: 2
herly is on a distinguished road
Dear Friends,

I need some help.

Can somebody create custom indicator as follows :

Line 1a
Price Open - (Previous Range / 5)

Line 1b
Price Open - (Previous Range / 2)

Line 2a
Price Open + (Previous Range / 5)

Line 2b
Price Open + (Previous Range / 2)


The line can changed automatic for all time frame, its mean can automatic change with each period (M30, H1 or H4).

Thank you for your help.

Kind Regards,
Herly

Last edited by herly; 08-22-2007 at 05:02 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #309 (permalink)  
Old 08-22-2007, 05:09 AM
Junior Member
 
Join Date: Aug 2007
Posts: 3
High is on a distinguished road
Very important question

What is the code for this?

if Bid was(not is)greater or equal to 1.3450, then.........???


Thanks all!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #310 (permalink)  
Old 08-22-2007, 06:45 AM
Willis11of12's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 105
Willis11of12 is on a distinguished road
Quote:
Originally Posted by High View Post
What is the code for this?

if Bid was(not is)greater or equal to 1.3450, then.........???


Thanks all!
If by "was(not is)" you mean during the previous bar then you can use:
iHigh(NULL,0,1) to return the highest bid price of the previous bar to see if the Bid "was" greater than X price. If you want to see if a bid during the current bar but not the current price was greater than X price that can also be done but is a little more tricky but easy enough. PM if you need more help.
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:29 PM.



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