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
  #751 (permalink)  
Old 03-08-2008, 06:38 PM
Member
 
Join Date: Dec 2005
Posts: 59
adria is on a distinguished road
EA doesn't work

Can someone fix this EA?
The EA should work:

Buy - MA crosses from below the High of the bar (bar shift at 11 o'clock chart time).

Sell - MA crosses from above the Low of the bar (bar shift at 11 o'clock chart time).
Attached Files
File Type: mq4 DAILY_GBPUSD_M15.mq4 (11.4 KB, 19 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #752 (permalink)  
Old 03-09-2008, 07:27 PM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
adria

You didn't state the problem.

Big Be
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #753 (permalink)  
Old 03-10-2008, 07:20 AM
Member
 
Join Date: Dec 2005
Posts: 59
adria is on a distinguished road
When I backtest, it doesn't open the trades according to the set time (11 o'clock).
I think that iBarShift function is not entered correctly.
The EA should open the buy order after 11 o'clock when MA is higher then the
High of the bar which is placed at 11 o'clock.
The EA should open the sell order after 11 o'clock when MA is lower then the
Low of the bar which is placed at 11 o'clock.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #754 (permalink)  
Old 03-10-2008, 11:58 AM
Alberto_Jazz's Avatar
Junior Member
 
Join Date: Feb 2008
Posts: 2
Alberto_Jazz is on a distinguished road
Could you find the mistake?

Hi, could you take a look to the attached EA?
I seem it doesn't work as I want.

BUY opening: when the closing price cross the 65 EMA and the 20 EMA is over the 65 EMA. (The opposite for SELL opening).

Where is my mistake?

Thank you!
Attached Files
File Type: mq4 EMA_3_20.mq4 (3.9 KB, 7 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #755 (permalink)  
Old 03-10-2008, 08:45 PM
Member
 
Join Date: Dec 2006
Location: Minnesota, USA
Posts: 84
mrebersv is on a distinguished road
Need help debugging indicator

I rather like the indicator at tradethemarkets.com titled the TTM-Bricks. That is to say, I rather like the TTM implementation of the 3-line break (3LB). There are some MT4 versions of the 3LB floating around, but they are as seperate windows and since 3LB is not completely time-dependent, it doesn't vertically match up. Thus, I thought I'd impelement 3LB like TTM does. Anyway, I don't have a copy of the 3LB indicator to attach, but I am attaching my version.

My version compiles and attaches, but does not actually draw. I'm sure I'm just missing something stupid or doing something backwards, so it'd be nice to get another set of eyes on the code. Can anyone help me debug this thing?

-MRE-
Attached Files
File Type: mq4 MRE-Bricks.mq4 (4.8 KB, 16 views)
__________________
I'm open to professionally developing EAs. PM me if you're interested.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #756 (permalink)  
Old 03-10-2008, 09:43 PM
Member
 
Join Date: Nov 2005
Posts: 54
4xCoder is on a distinguished road
For debugging MQ4 objects, they all appear in a list in Charts>Objects>Objects List (or use ctrl-b).

One issue I see is that you're using the same name for all the objects, which means you'll only create one object and just move it all over the place. You need to create a unique name for each object.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #757 (permalink)  
Old 03-11-2008, 12:26 AM
Junior Member
 
Join Date: Aug 2007
Posts: 2
dodo is on a distinguished road
Help needed

After struggling for a while, i was finally able to get my indicator to print a vertical bar where i want it.

now the question is how to do what i want...

heres the idea

im placing a vertical line every 24hrs and i want to calculate the high, close, open and low inside every 2 vertical bars.i also need to find the range

"high-low"

any comments on how to start this? or what to read in order to grasp the idea?

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #758 (permalink)  
Old 03-11-2008, 05:04 AM
Senior Member
 
Join Date: Oct 2007
Posts: 224
Dave137 is on a distinguished road
Question How do I get this value right??

PHP Code:
 PM30=iCCI(NULL,30,3,0,0);  
 
PM30_1=iCCI(NULL,30,3,0,1); 
This does not work??

Instead of giving the value of CCI 1 bar back - PM30_1=iCCI(NULL,30,3,0,1) - on the one minute graph I have placed the indicator on, it gives back the value of CCI 1 major step change back.

How do I get the value of this CCI 30 minute indicator 1 bar back on the 1 minute graph???

Would this be equivalent to iCCI(NULL,1,90,0,1) ?? This does not work either!

Need experts input - This has me puzzled!

Dave

Last edited by Dave137; 03-11-2008 at 05:18 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #759 (permalink)  
Old 03-11-2008, 05:47 AM
Member
 
Join Date: May 2007
Posts: 40
gmax111 is on a distinguished road
I need some help...

im writing an EA that buys and sells the EMA crosses.. I want to filter it by checking if the last 10 bars closes were above the EMA before buying...

can anyone help me???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #760 (permalink)  
Old 03-11-2008, 10:40 PM
Junior Member
 
Join Date: May 2006
Posts: 12
mach_one_man is on a distinguished road
Ichimoku Kinko Hyo Cross only opens Buy's!

Hello All,

Have been programming for the past few weeks and coming along reasonably well. But I have hit a point here where my latest fairly simple system that I am trying to code will not work for me. I have re written it about five times, using different code, tried Expert Advisor builders and altering other cross strategies e.t.c. but the system will only ever open Buy Trades. (Among other problems I have) any help would be much appreciated as it seems like it could be a profitable system. (Ok everyone seems to think this when programming them, but manual bar by bar backtests show a positive outcome.)

THE SYSTEM: Chart Setup
The Ichimoku Kinko Hyo indicator with default 9,26,52 settings. Only show the Tenkan-Sen and Kijun-Sen, hide the Senkou and Chikou lines.

FIRST ENTRY (explained for long/buy - same applies for sell in op. direction)
Tenkan-Sen crosses Kijun-Sen and price is above KIJUN-Sen. Stop loss the amount of the pairs spread below Tenkan-Sen. Trail with stop at Kijun-Sen - spread pips unless reverse signal occurs (where you close).

RE-ENTRY (sometimes a few trades get stopped out before catching the "big ride"
If stop loss is hit, before crossing of Tenkan-Sen and Kijun-Sen a position can be reopened if the price closes above the TENKAN-Sen and the Tenkan-Sen is still above the Kijun-Sen. Stop loss as before.

SUMMARY
Enter long when Tenkan-Sen Crosses above Kijun-Sen. Stop loss a spreads distance below Kijun-Sen. If stopped out before cross and reversal occurs, can re-enter a long position if price rises above Tenkan-Sen. No Take Profit, just trail the stop loss on the Kijun-Sen.

This system does tend to like trends, but the losses should not be too great in the range-bound markets. I plan to trade on daily TF's but possible others when I get the Expert running. In fact, on some markets I have tested, the EA is profitable at the moment, before its even working properly!

MQ4 attached if anyone can decipher where I am going wrong!

Thanks,
Howard

P.S. It would be great to receive some help on this as its my Birthday tommorow and it would be very nice to receive some help!

I also apologise to all the Ichimoku practitioners out there that feel it should not be automated as it is meant to be trading the market "at a glance". However I feel the indicator is so wonderful, especially the Kijun-Sen, which trades just outside the retracements in many long trends that it is perfect for automation!
Attached Files
File Type: mq4 IKH Pro.mq4 (4.5 KB, 18 views)
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:18 PM.



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