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 (2) Thread Tools Display Modes
  #191 (permalink)  
Old 07-24-2006, 05:05 PM
summitfx's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 289
summitfx is on a distinguished road
Alerts

I have a ?. Is it possible to set up an alert(text message) for a simple crossing or color change like the chart below? If so, who can program this for me?
Attached Images
File Type: gif ff.gif (25.1 KB, 164 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #192 (permalink)  
Old 07-24-2006, 10:50 PM
Member
 
Join Date: Mar 2006
Posts: 33
dr_richard_gaines is on a distinguished road
alerts for indicators

Quote:
Originally Posted by summitfx
I have a ?. Is it possible to set up an alert(text message) for a simple crossing or color change like the chart below? If so, who can program this for me?
Hi

Post the source code of the indicator and we will see. Is this lsma indicator ?

Doc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #193 (permalink)  
Old 07-25-2006, 12:34 AM
summitfx's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 289
summitfx is on a distinguished road
lsma

Yes, this is the lsam indicator!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #194 (permalink)  
Old 07-25-2006, 01:56 PM
summitfx's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 289
summitfx is on a distinguished road
lsma code

Doc,

Here is the source code for the lsma. Thanks for your input!

//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Chartreuse
#property indicator_color3 Red

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
int width;

extern int Rperiod = 34;
extern int Draw4HowLongg = 300; // 500 // 1000
int Draw4HowLong;
int shift;
int i;
int loopbegin;
double sum[];
int length;
double lengthvar;
double tmp ;
double wt[];
int c;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(5);

//---- drawing settings
SetIndexBuffer(2,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(0,ExtMapBuffer3);
SetIndexBuffer(3,sum);
SetIndexBuffer(4,wt);

SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);

//---- initialization done
return(0);
}

int start()

{ Draw4HowLong = Bars-Rperiod - 5;
length = Rperiod;
loopbegin = Draw4HowLong - length - 1;

for(shift = loopbegin; shift >= 0; shift--)
{
sum[1] = 0;
for(i = length; i >= 1 ; i--)
{
lengthvar = length + 1;
lengthvar /= 3;
tmp = 0;
tmp = ( i - lengthvar)*Close[length-i+shift];
sum[1]+=tmp;
}
wt[shift] = sum[1]*6/(length*(length+1));

//========== COLOR CODING ===========================================

ExtMapBuffer3[shift] = wt[shift]; //red
ExtMapBuffer2[shift] = wt[shift]; //green
ExtMapBuffer1[shift] = wt[shift]; //yellow

// for(c=loopbegin;c==shift;c++)
// {
if (wt[shift+1] > wt[shift])
{
ExtMapBuffer2[shift+1] = EMPTY_VALUE;
// ObjectCreate("smiley_face", OBJ_ARROW, 0, Time[shift], Low[shift]-Point*20);
// Print("time= ",Time[shift]);
// ObjectSet("smiley_face", OBJPROP_ARROWCODE, 242);
// ObjectSet("smiley_face", OBJPROP_COLOR , Red);
// ObjectSet("smiley_face", OBJPROP_WIDTH , 1);
// ObjectsRedraw();

//ExtMapBuffer3[shift+1] = EMPTY_VALUE;
//ExtMapBuffer3[shift+1] = EMPTY_VALUE;

}
else if (wt[shift+1] < wt[shift])
{
ExtMapBuffer1[shift+1] = EMPTY_VALUE; //-1 red/greem tight
//ExtMapBuffer3[shift+1] = EMPTY_VALUE;

}
else
{

ExtMapBuffer1[shift+1]=CLR_NONE;//EMPTY_VALUE;
ExtMapBuffer2[shift+1]=CLR_NONE;//EMPTY_VALUE;
}

}

return(0);
}
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #195 (permalink)  
Old 07-27-2006, 10:13 AM
Member
 
Join Date: Feb 2006
Location: malaysia
Posts: 44
dreamer is on a distinguished road
hii guyss

i want to know how to write this code into ea


rsi 14
parameter setting 30 and 70


buy
-rsi cross above line 30 from below( first the rsi should cross below line 30 from above then only cross back the line where the signal is valid)

sell
-rsi cross below line 70 from above( first the rsi should cross above line 70 from below then only cross back the line where the signal is valid)



thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #196 (permalink)  
Old 07-27-2006, 03:10 PM
Junior Member
 
Join Date: Jul 2006
Posts: 17
quangmach is on a distinguished road
how to add trade time to EA??
ex: EA not trading in 14~20h and trading normal in another times !

and close all profitable trading,and hold lose trading before 14h???

thanks

(sorry for my bad english)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #197 (permalink)  
Old 07-27-2006, 04:23 PM
Administrator
 
Join Date: Sep 2005
Posts: 16,816
Blog Entries: 145
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by quangmach
how to add trade time to EA??
ex: EA not trading in 14~20h and trading normal in another times !

and close all profitable trading,and hold lose trading before 14h???

thanks

(sorry for my bad english)
I am not sure but it may be opposite with timefilter, for example, after start add something like this:

Code:
if (UseHourTrade){
      if ((Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
         Comment("Time for trade has not come else!");
         return(0);
   }  
   }
And in the settings of EA add the following:

Code:
extern bool UseHourTrade = True;
extern int FromHourTrade = 14;
extern int ToHourTrade = 20;
But please note that the time (14 and 20) is Metatrader time (depends on the broker). Besides it depends on timeframe which you are using your EA with. For example if close bar will be at 15 so it will be from 15 till 20 irrespective of your 14 - 20. Depends on the close bars.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #198 (permalink)  
Old 07-27-2006, 05:43 PM
Junior Member
 
Join Date: Jul 2006
Posts: 17
quangmach is on a distinguished road
Quote:
Originally Posted by newdigital
I am not sure but it may be opposite with timefilter, for example, after start add something like this:

Code:
if (UseHourTrade){
      if ((Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
         Comment("Time for trade has not come else!");
         return(0);
   }  
   }
And in the settings of EA add the following:

Code:
extern bool UseHourTrade = True;
extern int FromHourTrade = 14;
extern int ToHourTrade = 20;
But please note that the time (14 and 20) is Metatrader time (depends on the broker). Besides it depends on timeframe which you are using your EA with. For example if close bar will be at 15 so it will be from 15 till 20 irrespective of your 14 - 20. Depends on the close bars.
wow,thanks so much
and how about

Quote:
and close all profitable trading,and hold lose trading before 14h???
is it possible??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #199 (permalink)  
Old 07-31-2006, 04:20 PM
Senior Member
 
Join Date: Mar 2006
Location: USA/Mexico
Posts: 226
kiwigold is on a distinguished road
Comment Color

Hi --

Is there a way to change the color on the indicator's comments -- the ones that show in separate windows ?

If so -- how ?

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #200 (permalink)  
Old 07-31-2006, 06:29 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
Quote:
Originally Posted by kiwigold
Hi --

Is there a way to change the color on the indicator's comments -- the ones that show in separate windows ?

If so -- how ?

thanks
U can make it by using labels. Label can be placed in any place of selected window, it also can have any font u want and any colour/size etc. So U can use label as a comment place it x=20 and y=20 and set color of the font as u want.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, ZUP_v1.mq4

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/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


All times are GMT. The time now is 06:27 AM.



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