| / | Forum |
|
mk77ch
2011.05.11 21:01
Hello, I try to code an indicator in a separate window which is displaying a consistent wave between 1 and -1. Does anybody know such an indicator? It would be great to use it with the dominant cycle and show the market cycles. thank you and best regards, |
|
Program Folder of MetaTrader 4 Client Terminal The article describes the contents of the program folder of MetaTrader 4 Client Terminal. The article will be useful for those who have already started to grasp into the details of the client terminal operation. |
|
zzuegg
2011.05.11 21:14
#property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red //---- buffers double sin[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,sin); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ extern double streching=0.1; double pi=3.14159265; int start() { int counted_bars=IndicatorCounted(); //---- for(int i =Bars-counted_bars-1;i>=0;i--){ sin[i]=MathSin((i*streching)); } //---- return(0); } //+------------------------------------------------------------------+ |
|
barli
2011.05.12 10:13
looks very interesting.. zzuegg, have you coded any EA with this indicator? By the way, I went to your web site and didn't find any EA's on there.. indicators look interesting
|
|
zzuegg
2011.05.12 10:35
No this was only an example to show you how to create a sinus wave looking indicator. For a cycle analysis you need a streching and a shift variable. BTW, this indicator works only in history, for the current bar, (i is always 0) it will not change value- You have to find a starting point and the peaks/bottoms, maybe in combination with some regression analysis to draw automatic cycles, if you combine multiple timeframes you might get an overview of the dominat cycles. Yea, website is beeing reworked, so currently we are not anymore updating this one. I have currently EA are currently in testing, they are not yet on the site because i am going to offer only forward tested EA's and i currently do not have enough testing data for a good strategy summary. cheers Michael |
|
mk77ch
2011.05.12 13:56
you are my hero, thank you very much :) so if i know the dominant cycle period, the phase and the amplitude, would it be possible to addapt these informations to this indicator? than you and best regards, mike |
|
zzuegg
2011.05.12 14:34
sure, the amplitude is not needed, the phase would be the same as the streching variable in the code from above, and the shift would be easy to implement, just change sin[i]=MathSin((i*streching)); TO sin[i]=MathSin(((i+shift)*streching)); |
|
barli
2011.05.12 16:50
zzuegg: sure, the amplitude is not needed, the phase would be the same as the streching variable in the code from above, and the shift would be easy to implement, just change sin[i]=MathSin((i*streching)); TO sin[i]=MathSin(((i+shift)*streching)); Did you try doing any EA with this Sinus indicator? Also what is your Scalpers Sweetspot is based upon? |
|
zzuegg
2011.05.12 18:28
i have sent you a pm
|