| New signals service! | |
|
|||||||
| 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 |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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); } //+------------------------------------------------------------------+ |
|
|||
|
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........ ![]() |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |