Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 Thread Tools Display Modes
  #11 (permalink)  
Old 11-12-2005, 02:13 PM
Junior Member
 
Join Date: Nov 2005
Posts: 14
homicida is on a distinguished road
oh the only thing i want is to call it und get the current trend back.

like "1" for up "2" for down and "3" for side.

thats whats im trying to get done.

cause your code works right.

i know know my main problem is the lack of knowledege about the indicator

so i cant interpret the returnvalues in the right way.

but i cant find some info on for it.


greets homi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 11-12-2005, 02:37 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Lightbulb Ok!

Quote:
Originally Posted by homicida
oh the only thing i want is to call it und get the current trend back.

like "1" for up "2" for down and "3" for side.

thats whats im trying to get done.

cause your code works right.

i know know my main problem is the lack of knowledege about the indicator

so i cant interpret the returnvalues in the right way.

but i cant find some info on for it.


greets homi
homi,

This will need a little modification in LSMA itself, to make it return the direction of the indicator's line ("1" for up "2" for down and "3" for side) with the ordinary the three values of the indicator's lines.

I did it But I can't test it before Monday .
__________________
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!
Reply With Quote
  #13 (permalink)  
Old 11-12-2005, 03:16 PM
Junior Member
 
Join Date: Nov 2005
Posts: 14
homicida is on a distinguished road
oh i want it plleeeaaassseee ^^

but you could probably post how youve done it ^^




greets homi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 11-13-2005, 07:48 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Wink Sure

Quote:
Originally Posted by homicida
but you could probably post how youve done it ^^
greets homi
Sure, I'll do.
__________________
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!
Reply With Quote
  #15 (permalink)  
Old 11-18-2005, 04:30 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Talking iCustom to get the current line color of LSMA.

Quote:
Originally Posted by homicida
but you could probably post how youve done it ^^
greets homi
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);
Attached Files
File Type: mq4 iCustom_Demo.mq4 (1.6 KB, 142 views)
File Type: mq4 LSMA in Color.mq4 (3.2 KB, 153 views)
__________________
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!
Reply With Quote
  #16 (permalink)  
Old 11-18-2005, 11:36 PM
Junior Member
 
Join Date: Nov 2005
Posts: 14
homicida is on a distinguished road
nice

really thx

im delayed too so no worrys.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 12-02-2005, 01:25 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Question

Quote:
Originally Posted by homicida
really thx

im delayed too so no worrys.
homicida,

Any good news for me ?
Did you try it?
__________________
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!
Reply With Quote
  #18 (permalink)  
Old 01-21-2006, 12:38 PM
Senior Member
 
Join Date: Oct 2005
Posts: 328
Perky is on a distinguished road
im interested in this subject too

your code as an indicator works well
but i want to access the 3 colors from an expert
and i seem not to be able to
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 04-27-2006, 02:10 AM
Member
 
Join Date: Mar 2006
Posts: 33
dr_richard_gaines is on a distinguished road
iCUSTOMS EXPERT ADVISOR DEMO

Quote:
Originally Posted by codersguru
Hi homi,

Let’s assume we want to return the value of the indicator “Supertrend” of a specific bar using iCustom.

If we want to get the returned value of the Supertrend first line:
We can write this price of code inside start() function:

Code:
double val=iCustom(NULL, 0, "SuperTrend",0,0,pos);
Here val will hold the returned value of Supertrend indicator(first line).

If you want the returned value of the second line, we can write:

Code:
double val=iCustom(NULL, 0, "SuperTrend",0,1,pos);
This is a program which will use Supertrend indicator using iCustom:


Code:
#property copyright "Coders Guru"
#property link      "http://www.forex-tsd.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }


int start()
  {
   int    counted_bars=IndicatorCounted();
 
//---- check for possible errors
   if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if (counted_bars>0) counted_bars--;
   
   int pos=Bars-counted_bars;
   
     
 
   while(pos>=0)
     {
         ExtMapBuffer1[pos] = iCustom(NULL, 0, "SuperTrend",0,0,pos);
         ExtMapBuffer2[pos] = iCustom(NULL, 0, "SuperTrend",0,1,pos);

         pos--;
     }
     
     
     
//----
   return(0);
  }
//+------------------------------------------------------------------+

Hi

Can we get one of these for experts too thanks.

Doc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 02-02-2008, 05:21 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,159
matrixebiz is on a distinguished road
Just wanted to get the end values of the iCustom line clarified in my head.
Line and Shift

So if I have an Indicator like VQ that only has one graphical line and I what to find out, on the previous closed candle, if it signaled up Arrow for a Buy condition or if it signaled a Sell condition by going down Arrow I would need to set up two condition like;
Code:
double VQ0 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 1,1);
double VQ1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 2,1);
So the above is going to check for an up condition (up) or sell (down) condition on the closed bar, correct?

Then my Buy and Sell code should be; correct?
Code:
//Buy
   if (VQ0>VQ1 && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))

//Sell
   if (VQ0<VQ1 && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))
Now if I wanted to add a second indicator so that TWO conditions need to be met at the same time to trigger a trade, it has two graphical lines (Don't know if it matters by how many lines it has, the indicator knows what it's Buy and Sell conditions are, correct?) My code would change to;
Code:
double VQ0 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 1,1);
double VQ1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 2,1);
double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 1, 1);
double QQEA1 = iCustom(NULL, 0, "QQEA",5,14,4.236, 2, 1);
and Buy and Sell code should be
Code:
//Buy
   if (VQ0>VQ1 && QQEA0>QQEA1 && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))

//Sell
   if (VQ0<VQ1 && QQEA0<QQEA1 && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))
Edit: Just did a back test and it seems to be trading like every M30 (Chart TF). I only want it to initiate the trade ONLY at first Signal condition then wait until the next opposite signal condition. Seems like when both indicators agree on a Buy then it trades then when that trade is closed it continues another Buy trade on next candle if conditions are still met. That is not what I want I Only want one trade per Buy/Sell Signal. Thanks


Attached are two EA's one called My First EA that someone modified for me because they thought the conditions were wrong and one I did using a template call YourExpertAdvisor. Are they both correct?
Thank you
Attached Images
File Type: jpg VQ_QQEA.JPG (88.2 KB, 204 views)
Attached Files
File Type: mq4 My First EA 1indi.mq4 (9.1 KB, 27 views)
File Type: mq4 YourExpertAdvisor.mq4 (9.4 KB, 22 views)

Last edited by matrixebiz; 02-02-2008 at 06:18 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
icustom


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 50 09-18-2008 01:02 PM
iCustom question .. yaniv_av Indicators - Metatrader 4 16 06-20-2008 04:37 PM
icustom maje Questions 24 12-05-2007 09: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 07:18 PM
iCustom() problem billritz Indicators - Metatrader 4 5 08-23-2006 07:22 AM


All times are GMT. The time now is 07:23 PM.



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