Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course
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
  #21 (permalink)  
Old 02-02-2008, 09:00 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
If I understand it right, you want your EA to treat an unbroken series of indicator agreement as "one signal", rather than that each occasion of agreement is a signal.

One way to do so, is to make it a stateful EA and use a design as follows:
PHP Code:
static int last_signal 0;
int signal 0;
if ( <
buy conditions hold> ) signal 1;
if ( <
sell conditions hold> ) signal = -1;
if ( 
signal != && signal != last_signal ) {
    
// New signal series...
}
last_signal signal
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
  #22 (permalink)  
Old 02-02-2008, 09:13 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Quote:
Originally Posted by ralph.ronnquist View Post
If I understand it right, you want your EA to treat an unbroken series of indicator agreement as "one signal", rather than that each occasion of agreement is a signal.

One way to do so, is to make it a stateful EA and use a design as follows:
PHP Code:
static int last_signal 0;
int signal 0;
if ( <
buy conditions hold> ) signal 1;
if ( <
sell conditions hold> ) signal = -1;
if ( 
signal != && signal != last_signal ) {
    
// New signal series...
}
last_signal signal
Hi Ralph, maybe this thread I started will be more clear;
Please check my Simple EA

Thanks
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
  #23 (permalink)  
Old 02-03-2008, 01:34 AM
TheRumpledOne's Avatar
Banned
 
Join Date: Nov 2006
Posts: 802
TheRumpledOne is an unknown quantity at this point
Quote:
Originally Posted by codersguru View Post
homicida,

I'm so sorry for the delay.

Please find attached modified version of LSMA and iCustom_Demo.

I've added a new buffer to LSMA to hold the current color (1=red, 2=green and 3=yellow).
Where's (1=downtrend , 2=uptrend and 3=no trend).

To use iCustom function to get the value of this buffer, you may write:

Code:
double clr = iCustom(NULL,0,"LSMA in Color",14,1500,5,0);


Thanks Codersguru!!

I was able to create a version of my Digital Compass to use with disk indicators.
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
  #24 (permalink)  
Old 02-03-2008, 03:14 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
It would be nice if you, TheRumpledOne, also learn how to attach images rather than make them inline; with the junk you paste in, it just wastes a lot of space.
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
  #25 (permalink)  
Old 02-03-2008, 05:50 AM
TheRumpledOne's Avatar
Banned
 
Join Date: Nov 2006
Posts: 802
TheRumpledOne is an unknown quantity at this point
Quote:
Originally Posted by ralph.ronnquist View Post
It would be nice if you, TheRumpledOne, also learn how to attach images rather than make them inline; with the junk you paste in, it just wastes a lot of space.
If it's "junk", then why post it at all?
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
  #26 (permalink)  
Old 02-03-2008, 07:53 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by TheRumpledOne View Post
If it's "junk", then why post it at all?
I had a similar thought....
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
  #27 (permalink)  
Old 02-04-2008, 01:05 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
One question about iCustom.
Can you explain and give some examples regarding the Line and Shift variables with iCustom commands?
Thank you
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
  #28 (permalink)  
Old 02-04-2008, 01:28 PM
TheRumpledOne's Avatar
Banned
 
Join Date: Nov 2006
Posts: 802
TheRumpledOne is an unknown quantity at this point
Quote:
Originally Posted by matrixebiz View Post
One question about iCustom.
Can you explain and give some examples regarding the Line and Shift variables with iCustom commands?
Thank you
iCustom - MQL4 Documentation

mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Use MODE to tell your indicator what buffer you want. The support resistance indicators may use buffer 0 ( MODE=0 ) for resistance and buffer 1 ( MODE=1 ) for support.

SHIFT says to use the value from Bar(SHIFT) of the indicator called by iCustom.

Does that help?
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
  #29 (permalink)  
Old 02-04-2008, 02:09 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Quote:
Originally Posted by TheRumpledOne View Post
iCustom - MQL4 Documentation

mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Use MODE to tell your indicator what buffer you want. The support resistance indicators may use buffer 0 ( MODE=0 ) for resistance and buffer 1 ( MODE=1 ) for support.

SHIFT says to use the value from Bar(SHIFT) of the indicator called by iCustom.

Does that help?
Ok, I get Shift, will have to do more reading about Mode.

Do you code? I have this indicator that I call from my EA but not sure how to set it up properly. See pic.
it just has two lines and when Blue changes and lines up with the other line, Long signal is generated (Same idea with Red)
Tried a few different codes like the one I used with the VQ indicator;
double Entry1 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 1);
double Entry2 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 2);
double Up2 = iCustom(NULL, 0, "VQ", 24, 30....., 1, 2);
double Down2 = iCustom(NULL, 0, "VQ", 24, 30....., 2, 2);

Just not trading right.

Thanks
Attached Images
File Type: jpg CI.JPG (65.2 KB, 375 views)
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
  #30 (permalink)  
Old 02-04-2008, 02:33 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by matrixebiz View Post
Ok, I get Shift, will have to do more reading about Mode.

Do you code? I have this indicator that I call from my EA but not sure how to set it up properly. See pic.
it just has two lines and when Blue changes and lines up with the other line, Long signal is generated (Same idea with Red)
Tried a few different codes like the one I used with the VQ indicator;
double Entry1 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 1);
double Entry2 = iCustom(NULL, 0, "VQ", 24, 30....., 0, 2);
double Up2 = iCustom(NULL, 0, "VQ", 24, 30....., 1, 2);
double Down2 = iCustom(NULL, 0, "VQ", 24, 30....., 2, 2);

Just not trading right.

Thanks
If you are referring to the bottom indicator, which seems to be named "#MTF CI", then I think that possibly that indicator has 4 buffers: one each for the two colors of each line. You can bring up the Data Window (ctrl-D) to see which buffers the indicators have, as well as their indexes (the MODE argument to the iCustom call).
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
icustom, icustom function, iCustom()


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
Easy iCustom and Alerts! codersguru Indicators - Metatrader 4 58 04-13-2009 09:30 AM
iCustom question .. yaniv_av Indicators - Metatrader 4 16 06-20-2008 05:37 PM
icustom maje Questions 24 12-05-2007 10:26 AM
I need help on creating an Icustom statement for my EA using this indicator as input! iscuba11 Expert Advisors - Metatrader 4 4 09-11-2006 08:18 PM
iCustom() problem billritz Indicators - Metatrader 4 5 08-23-2006 08:22 AM


All times are GMT. The time now is 08:03 AM.



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