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

 
 
LinkBack (1) Thread Tools
 
Old 05-15-2008, 07:31 AM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by payback View Post
anyway it doesn't work and i don't understand and figure out why..

here are my variables
PHP Code:
 BuyValueCurrent   iCustom(NULL,TimeFrame,IndicatorName1,NumBars,0,1);  // braintrend1 
PHP Code:
 BuyValueCurrent2   iCustom(NULL,TimeFrame,IndicatorName2,NumBars,0,1);  // braintrend2 
and here is the statement

PHP Code:
 BuyCondition  = (BuyValueCurrent != EMPTY_VALUE && BuyValueCurrent2 != EMPTY_VALUE); 
it gives totally fuzzy results even when the indicator (Braintrend2stop and BrainTrend1Stop) are SELL
I do not know your indic Braintrend1 and 2, I just assumed that when a buy condition is fulfilled, they draw an arrow on the chart. In MT4, the default buffer's value is a constant named "EMPTY-VALUE", so if there is no arrow the value returned by iCustom() is this constant, and if there is an arrow the returned value is the price where the arrow is put.
As I understood, you want to buy when both indics are showing an arrow, isn't that ?

Last edited by Michel; 05-15-2008 at 07:33 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 10:40 AM
Junior Member
 
Join Date: May 2008
Posts: 26
payback is on a distinguished road
yes is exactly what i want to do
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 01:17 PM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by payback View Post
yes is exactly what i want to do
So, please, check your iCustom() syntax.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 05:53 PM
Junior Member
 
Join Date: May 2008
Posts: 26
payback is on a distinguished road
what i have to check? maybe i miss something
PHP Code:
 double iCustomstring symbolint timeframestring name, ..., int modeint shift
well for what i suppose if there is a buy signal it is stored in buffer 0 else it is empty and buffer 1 has the sell signal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 08:06 PM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by payback View Post
what i have to check? maybe i miss something
PHP Code:
 double iCustomstring symbolint timeframestring name, ..., int modeint shift
well for what i suppose if there is a buy signal it is stored in buffer 0 else it is empty and buffer 1 has the sell signal
Post your indic here, I will look.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 09:53 PM
Junior Member
 
Join Date: May 2008
Posts: 26
payback is on a distinguished road
ok thx!
and please explain
Attached Files
File Type: mq4 BrainTrend1Stop.mq4 (5.3 KB, 2 views)
File Type: mq4 BrainTrend2Stop.mq4 (4.6 KB, 3 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-16-2008, 02:19 AM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by payback View Post
ok thx!
and please explain
Open BrainTrend1Stop.mq4.
At the begining of the file you can find :
PHP Code:
extern int       NumBars=500;
extern int       EnableAlerts=0;
extern int       SignalID=0
This means that you have to fill those three parameters as arguments in the iCustom() call, like this:
PHP Code:
BuyValueCurrent iCustom(NULL,0,"BrainTrend1Stop",NumBars,EnableAlerts,SignalID,0,1);  // braintrend1 
About the buffer's number, you can see this:
PHP Code:
#property indicator_color1 Magenta
#property indicator_color2 Aqua 
So the buffer 0 is Magenta and the buffer 1 is Aqua.
Thus if the Buy arrow's color is Aqua, the buffer's number is 1 and the iCustom call is:
PHP Code:
BuyValueCurrent iCustom(NULL,0,"BrainTrend1Stop",NumBars,EnableAlerts,SignalID,1,1);  // braintrend1 
A little lower you have:
PHP Code:
   SetIndexEmptyValue(1,0.0); 
This means that the default empty value for the buffer 1 is set to 0.0; so when there is no arrow, the value returned by the iCustom() call will be 0.0.
So you should know the presence of the arrow checking its value against 0, like this (if the second indic follows the same behavior):
PHP Code:
BuyCondition = (BuyValueCurrent && BuyValueCurrent2 0); 
About the second indic, I think you should be able to do the same analyse by yourself.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 11:44 AM
clarc's Avatar
Junior Member
 
Join Date: May 2006
Posts: 17
clarc is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
Here's the idea:



And in the start() function:



Hope that helps.

FerruFx
@FerruFx

thank your for your suggestion - i try to add your code into the EA, but everytime i get errorwarnings... if you have time, could you look into this EA how i do the mistakes (i have uploaded an clean version of the EA)

thank you for your help

clarc

Last edited by clarc; 05-17-2008 at 05:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 02:41 PM
Senior Member
 
Join Date: Feb 2007
Posts: 881
FerruFx is on a distinguished road
Quote:
Originally Posted by clarc View Post
@FerruFx

thank your for your suggestion - i try to add your code into the EA, but everytime i get errorwarnings... if you have time, could you look into this EA how i do the mistakes (i have uploaded an clean version of the EA)

thank you for your help

clarc
Done. Add the countlong and countshorts functions.

You missed a { at the beginning of the start function. It was for this reason you can't compile.

FerruFx
Attached Files
File Type: mq4 EA v2.0.mq4 (9.4 KB, 8 views)
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 05:02 PM
clarc's Avatar
Junior Member
 
Join Date: May 2006
Posts: 17
clarc is on a distinguished road
awsome, ferrufx ... Thanks a lot for this... i'm not a programmer, thats why its nearly impossible for me to do such changes...

regards

clarc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Bookmarks

Tags
CHinGsMAroonCLK, I_XO_A_H
Thread Tools

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 06: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 04:22 PM


All times are GMT. The time now is 10:40 AM.



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