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
  #861 (permalink)  
Old 11-17-2007, 04:29 PM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 702
wolfe is on a distinguished road
Anybody know how to do this?

Here is what I'm trying to code:

I have a chart with an RSI attached to it. Then I drag and drop a MA into the RSI window and choose apply to "previous indicator's data". Now my moving average is using the RSI values for it's calculations.

I can't figure out how to code this into an EA. The Applied_Price values in mq4 don't have the option to choose "previous indicator's data" for the moving average.

Basically trying to get the current moving average of the current RSI.

If you know what I'm trying to do and may have a solution I would greatly appreciate any help.

Thanks,

Wolfe

Last edited by wolfe; 11-17-2007 at 06:45 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #862 (permalink)  
Old 11-19-2007, 10:29 AM
Warren's Avatar
Junior Member
 
Join Date: Jan 2006
Posts: 9
Warren is on a distinguished road
need help for simple code

Dear colleagues!

I have a piece of code for time filter which disable EA on particular hours:

extern bool UseHourTrade = True;
extern int FromHourTrade = 8;
extern int ToHourTrade = 18;

-------------------------------------------------//

if (UseHourTrade){
if ((Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
Comment("Non-Trading Hours!");
return(0);
____________________________________________

BUT I want to disable EA exactly on Friday before weekend. I don't need any open position after 8.00 CET on Friday. Could You do me a favour to post such kind of code or correct above mentioned code?

I ask for Your advice because I'm not a programmer

Best regards,
Warren
__________________
Short Term Pain for Long Term Gain!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #863 (permalink)  
Old 11-21-2007, 11:54 AM
BornToWin's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 26
BornToWin is on a distinguished road
To reduce PC's resource

I saw sample code, usually each code calculate itself every ticks,
mean every single feed price from server, the group of code calculate by itself.
Then PC's at client terminal will process or calculate every ticks, this make client PC's need more resource, like RAM & CPU

Idea to reduce PC's resource & iteration at client terminal, If we can control that group of code to calculate at :
1. Every complete minutes and don't calculate at every ticks.
2. Every complete M1 bar and don't calculate at every ticks
Anyone can give sample code to do that ?

best regards,

BornToWin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #864 (permalink)  
Old 11-21-2007, 12:37 PM
ValeoFX's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Johannesburg, South Africa
Posts: 1,024
ValeoFX is on a distinguished road
Alert on any MTF indicator...

Codersguru,

Is it possible to add an Alert (preferably a voice) to a MTF indicator? I want to have the Alert sound when all 3 criteria are met in my RSI-3TF if possible.

Thank you for replying.

Sincerely.
__________________
"Risk comes from not knowing what you are doing" The Tao of Warren Buffett.

"Avoiding mistakes, makes people STUPID and having to be RIGHT, makes you OBSOLETE." Robert Kiyosaki.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #865 (permalink)  
Old 11-21-2007, 01:26 PM
Senior Member
 
Join Date: Feb 2006
Posts: 519
Michel is on a distinguished road
Quote:
Originally Posted by BornToWin View Post
I saw sample code, usually each code calculate itself every ticks,
mean every single feed price from server, the group of code calculate by itself.
Then PC's at client terminal will process or calculate every ticks, this make client PC's need more resource, like RAM & CPU

Idea to reduce PC's resource & iteration at client terminal, If we can control that group of code to calculate at :
1. Every complete minutes and don't calculate at every ticks.
2. Every complete M1 bar and don't calculate at every ticks
Anyone can give sample code to do that ?

best regards,

BornToWin
PHP Code:
if(iVolume(NULL,PERIOD_M1,0) == 1)
{
      
//do what you want here, first tick of every M1 bar.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #866 (permalink)  
Old 11-22-2007, 03:18 AM
BornToWin's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 26
BornToWin is on a distinguished road
Got the key ! Any other idea ?!

Thanks for reply Michel,

I got the key.

But sometimes the volume of first tick of every M1 bar > 1
While iVolume() > 1 at the first tick, the calculation didn't done !?
Or the first tick of that M1 bar must be = 1 ?

And we can't change expression to >= 1, right ?
That will make this idea turn to useless, cause it calculate to the end of that bar live !
My idea is to calculate only at the complete of TF M1.

Any other idea ?

BornToWin

Quote:
Originally Posted by Michel View Post
PHP Code:
if(iVolume(NULL,PERIOD_M1,0) == 1)
{
      
//do what you want here, first tick of every M1 bar.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #867 (permalink)  
Old 11-22-2007, 06:30 AM
Senior Member
 
Join Date: Feb 2006
Posts: 519
Michel is on a distinguished road
Quote:
Originally Posted by BornToWin View Post
Thanks for reply Michel,

I got the key.

But sometimes the volume of first tick of every M1 bar > 1
While iVolume() > 1 at the first tick, the calculation didn't done !?
Or the first tick of that M1 bar must be = 1 ?

And we can't change expression to >= 1, right ?
That will make this idea turn to useless, cause it calculate to the end of that bar live !
My idea is to calculate only at the complete of TF M1.

Any other idea ?

BornToWin
I never see that volume jump with a gap from 0 to 2
Anyway, you can use this:
PHP Code:
int bars;   //on global scope
void start()
{
   if(
ibars(NULL,PERIOD_M1) > bars)
   {
      
bars ibars(NULL,PERIOD_M1);
      ....    
//here I am at the open of every M1 bar
   
}
   ....

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #868 (permalink)  
Old 11-25-2007, 08:55 AM
BornToWin's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 26
BornToWin is on a distinguished road
Thanks Michel,

Thanks Michel,

I will try it.

Did you know where and how can we got server for MT4 that can feed simulation price at weekend ?
This is to test our code at weekend ( non trading days )
Any idea ?

Quote:
Originally Posted by Michel View Post
I never see that volume jump with a gap from 0 to 2
Anyway, you can use this:
PHP Code:
int bars;   //on global scope
void start()
{
   if(
ibars(NULL,PERIOD_M1) > bars)
   {
      
bars ibars(NULL,PERIOD_M1);
      ....    
//here I am at the open of every M1 bar
   
}
   ....

__________________
BornToWin
Veni Vidi Vici
----------------------------------------------------------------
Knowledge is POWER, Experience is SKILL, Action got RESULT !
Yes I CAN !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #869 (permalink)  
Old 11-25-2007, 08:13 PM
Senior Member
 
Join Date: Feb 2006
Posts: 519
Michel is on a distinguished road
No, sorry, I do not know...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #870 (permalink)  
Old 11-29-2007, 01:00 PM
Member
 
Join Date: Oct 2006
Posts: 56
Jovager is on a distinguished road
Help please

In my EA, I have a SL=50.

How code if I will a SL of 50 OR a SL when an Moving Average crosses an other MA ?

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex

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 09:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 11:46 AM


All times are GMT. The time now is 07:22 AM.



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