Forex
Google

Go Back   Forex Trading > Discussion Areas > General Discussion
Forex Forum Register FAQ Members List Calendar Today's Posts


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
  #1 (permalink)  
Old 06-28-2006, 11:50 PM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Exclamation Help needed with alert display function!

The alert does not include what currency pair moving average crossed over. How do I correct this code to pickup and identify the currency pair name like USDJPY in the alert display??


//----------------------- ALERT ON MA CROSS
//----------------------- SOURCE : FIREDAVE
void subCrossAlert(string type)
{
string AlertComment;

if(type=="UP") AlertComment = "Moving Average Cross UP !";
if(type=="DOWN") AlertComment = "Moving Average Cross DOWN !";

Alert(AlertComment);
PlaySound(SoundFilename);
}

//----------------------- END FUNCTION

Your help is much appreciated! Thanks in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-28-2006, 11:58 PM
increase's Avatar
increase increase is offline
Senior Member
 
Join Date: May 2006
Posts: 605
increase is on a distinguished road
Guru guys jump on me from a great height if I am wrong, but isn't it this

,Symbol(),"-",Period()

Where symbol is pair and period is timeframe?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-29-2006, 12:13 AM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Cool

Quote:
Originally Posted by increase
Guru guys jump on me from a great height if I am wrong, but isn't it this

,Symbol(),"-",Period()

Where symbol is pair and period is timeframe?

I tried it this way - Came up with a bunch of errors.

if(type=="UP") AlertComment = "Moving Average Cross UP !", Symbol(),"-",Period();

Maybe I set it up wrong - Please advise.

Dave
<><<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-29-2006, 01:14 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
this is whut i use
Alert (Symbol()," ",Period(), "Phats Dirty Little Secret @ "Bid);
so maybe u would do something like
if(type=="UP") Alert (Symbol()," ",Period(), "Moving Average Cross UP @ "Bid;

Last edited by lowphat : 06-29-2006 at 01:16 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-29-2006, 01:41 AM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Cool

Quote:
Originally Posted by lowphat
this is whut i use
Alert (Symbol()," ",Period(), "Phats Dirty Little Secret @ "Bid);
so maybe u would do something like
if(type=="UP") Alert (Symbol()," ",Period(), "Moving Average Cross UP @ "Bid;

Here us what it looks like now. Now I get the error: 'end_of_program' unbalanced left parenthesis. Very frustrating!

//----------------------- ALERT ON MA CROSS
//----------------------- SOURCE : FIREDAVE
void subCrossAlert(string type)
{
string AlertComment;

//if(type=="UP") AlertComment = "Moving Average Cross UP !";
//if(type=="DOWN") AlertComment = "Moving Average Cross DOWN !";
if(type=="UP") Alert (Symbol()," ", Period(), "Moving Average Cross UP @ "Bid;

Alert(AlertComment);
PlaySound(SoundFilename);
}

//----------------------- END FUNCTION
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-29-2006, 01:44 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
doh I left out a parentheses at the end after bid

if(type=="UP") Alert (Symbol()," ",Period(), "Moving Average Cross UP @ "Bid);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-29-2006, 02:01 AM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Smile

Thanks Lowphat, it came up with an error referring to the bid but I really do not need that in the statement. I just wanted to be alerted to which of the 4 currencies crossed over and what direction. There is a couple other errors in the program I need to address yet.

Since I got your attention. How do you start and stop a program to trade (7 GMT to 18 GMT)? Another part lacking in the Universal MA program.

extern string
Time_Parameters = "---------- EA Active Time";
extern bool
UseHourTrade = false;
extern int
StartHour = 10,
EndHour = 11;


//----------------------- TIME FILTER
if (UseHourTrade)
{
if(!(Hour()>=StartHour && Hour()<=EndHour))
{
Comment("Non-Trading Hours!");
return(0);
}
}

All FireDave has in this program is a comment statement. How do I start and stop the program from trading??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-29-2006, 02:20 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 199
lowphat is on a distinguished road
go to properties and see if you can set UseHourTrade to =TRUE
I believe if you want to use GMT and your MT company is using gmt you can just put in the hours you want it to trade
StartHour 7
EndHour 18
in properties
if your charts are not based in GMT you have to calculate the shift
by the code you pasted it dont appear to be lacking
lemem get the source and look at it for the cross i told ya wrong for the way the alerts are coded there

Last edited by lowphat : 06-29-2006 at 02:32 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-29-2006, 02:31 AM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Unhappy

Guess what Lowphat, the alert fired, but the symbol never showed up in the display - Darn It! This language stinks to work with. Someone needs to create tons of examples of how to do various things in this language. It is one step up from Assembly Language. Most people are probably to young to remember the nightmare of Assembly Language (20+ years ago). This is close to it.

if(type=="UP") Alert (Symbol()," ", Period(), "Moving Average Cross UP !");
if(type=="DOWN") Alert (Symbol()," ", Period(), "Moving Average Cross DOWN !");

If you or anyone come up with something that works to display the currency pair in the alert display window, I would appreciate it.

Dave
<><<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-29-2006, 02:32 AM
iscuba11's Avatar
iscuba11 iscuba11 is offline
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Quote:
Originally Posted by lowphat
go to properties and see if you can set UseHourTrade to =TRUE
I believe if you want to use GMT and your MT company is using gmt you can just put in the hours you want it to trade
StartHour 7
EndHour 18
in properties
if your charts are not based in GMT you have to calculate the shift
by the code you pasted it dont appear to be lacking

Thanks, I will test it out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Needed To Change Indicator Display MMRPS Digital Filters 5 01-03-2008 09:42 AM
Chart display in MT4 oneprint Metatrader 4 4 11-07-2006 04:48 PM
I Trend Display 006 Metatrader 4 6 08-22-2006 12:52 PM
Can an EA display Indicators? FXGamer Metatrader 4 1 05-19-2006 06:06 PM


All times are GMT. The time now is 01:58 PM.