Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4


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 02-23-2007, 05:14 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Speed-/Acceleration-System

Hello,
I hope, someone can help me. I have written an Indicator - now I want to build an EA with it.
The Indicator calculates two momentums.
The first Indicator-Buffer is called "MomBurst", the second one is"Momdt".
As you can see in the graphes, if both of them turn up under the range<300 its time to go long. If both of them turn down over the range>300 its time to go short.
Can someone help me, creating an EA with this?
I don´t know, how to generate the signals.
If someone could code that, i would be very happy.

Here is the source:
=====================
//+------------------------------------------------------------------+
//| First_Indicator.mq4 |
//| JustY |
//| |
//+------------------------------------------------------------------+
#property copyright "JustY"
#property link ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Silver
//---- Parameter
extern int time1 = 3;
extern int time2 = 5;
extern int time3 = 7;

//---- buffers
double MomBurst[];
double Momdt[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(0,MomBurst);
SetIndexBuffer(1,Momdt);
string short_name = "MomentumBurst";
IndicatorShortName(short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----Check for Errors
if (counted_bars<0) return(-1);
//----last countet bar will recountet
if (counted_bars>0) counted_bars--;

int pos=Bars-counted_bars;
double dMedian1, dMedian2, dMedian3, dResult;
Comment("Hi! I´m here on the main chart window!");
//----main calculation loop

while(pos>=0) //---- Berechnung des Momentum (Geschwindigkeit)
{
dMedian1 = (High[pos+time1] + Low[pos+time1] + Open[pos+time1] + Close[pos+time1]) / 4;
if (dMedian1 == 0) dMedian1 = 1; // Division durch Null verhindern
dResult = Close[pos]*100/dMedian1; // temporäres Momentum
dMedian2 = (High[pos+time2] + Low[pos+time2] + Open[pos+time2] + Close[pos+time2]) / 4;
if (dMedian2 == 0) dMedian2 = 1; // Division durch Null verhindern
dResult = dResult + Close[pos]*100/dMedian2; // temporäres Momentum
dMedian3 = (High[pos+time3] + Low[pos+time3] + Open[pos+time3] + Close[pos+time3]) / 4;
if (dMedian3 == 0) dMedian3 = 1; // Division durch Null verhindern
dResult = dResult + Close[pos]*100/dMedian3; // temporäres Momentum
MomBurst[pos] = dResult; // Summe der drei Momentum
pos--; // Inkrementiere Bar
}

pos=Bars-counted_bars; //---- Berechnung der Momentumänderung (Beschleunigung)
while(pos>=0)
{
dMedian1 = MomBurst[pos+time1];
if (dMedian1 == 0) dMedian1 = 1;
dResult = MomBurst[pos]*100/dMedian1;
dMedian2 = MomBurst[pos+time2];
if (dMedian2 == 0) dMedian2 = 1;
dResult = dResult + MomBurst[pos]*100/dMedian2;
dMedian3 = MomBurst[pos+time1];
if (dMedian3 == 0) dMedian3 = 1;
dResult = dResult + MomBurst[pos]*100/dMedian3;
Momdt[pos] = dResult;
pos--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Attached Files
File Type: mq4 First_Indicator-sicherung.mq4 (3.8 KB, 114 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-24-2007, 07:17 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Can´t someone help me?
I only need to get the signals for buy/sell.
Something like this:
signal = 1 // buy
signal = 2 // sell
signal = 0 // do nothing

if( (MomBurst[now] > MomBurst[no+1]) & (Momdt[now] > Momdt[now+1]) ) signal = 1;

if( (MomBurst[now] < MomBurst[no+1]) & (Momdt[now] < Momdt[now+1]) ) signal = 1;

But it looks like, that it doesn´t work.
I am not really good in programming (and english ) with arrays, thats my problem.
Do I have to put the whole operation-block in a while{...}-function, like the other calculations, too?

Need help........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2007, 11:40 AM
Member
 
Join Date: Oct 2006
Posts: 79
takechance is on a distinguished road
Visually I don't understand your indicator and system at all.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-24-2007, 12:42 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Just look some minutes on the indicatorwindow and you will see it.
The red one is the course-speed, the silver one is the course-acceleration.
If both are positive, you just buy, when both are negative, you go short.

Later, a filter comes into the system to reduce the fail-signals like the last one, i had markered.

But first i have to get the signals to go long/short. I can´t code it, because I don´t really understand working with arrays.

I hope, now someone can help me.
Attached Images
File Type: jpg mom.JPG (96.5 KB, 189 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-24-2007, 05:45 PM
Member
 
Join Date: Nov 2006
Location: Berlin
Posts: 41
hbud is on a distinguished road
Hi JustY , moin moin

Leider bin ich kein Coder und kann Dir nicht wirklich helfen, aber wenn Du vielleicht mal einen schon vorhandenen crossover EA nimmst und den/die alten Indikatoren kickst und durch Deinen erstzt via iCustom Indicator?
Hab ich schon öfter gemacht. Ist aber nicht das, was Du wirklich willst,oder?
Ich meine bevor Du gar nicht weiterkommst...?!?


Why don't you take an already existing crossover EA and change out the indicators with your new one? For now at least.

hbud
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-24-2007, 05:51 PM
Senior Member
 
Join Date: Oct 2006
Posts: 202
aegis is on a distinguished road
Quote:
Originally Posted by justize
Just look some minutes on the indicatorwindow and you will see it.
The red one is the course-speed, the silver one is the course-acceleration.
If both are positive, you just buy, when both are negative, you go short.

Later, a filter comes into the system to reduce the fail-signals like the last one, i had markered.

But first i have to get the signals to go long/short. I can´t code it, because I don´t really understand working with arrays.

I hope, now someone can help me.
You're using discretion. I can tell by looking at your chart, so it can't be automated or traded mechanically. Your first trade, a buy, would not have came until the next bar. You didn't know that the indicator turned up until the next bar. The next trade, a sell, would not have came until the close of the following bar. The red line wasn't pointing down yet. The third trade would not have came until the following bar as well. You need to be careful of this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2007, 09:04 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Hm, maybe...

But I really wanna test this idea. I need help to get the signals.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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
For those who use Opera; New Speed Dial feature Diam0nd Non Related Discussions 0 02-28-2007 11:51 PM
server speed forexts General Discussion 4 12-13-2005 06:28 PM


All times are GMT. The time now is 01:26 AM.



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