Aha,yes... Will look into that immediately.thiru wrote: Sun Jul 21, 2019 7:32 am If not mistaken, this concept of extreme originated with Symphonie Trader System many years before. Its still an active group with over 18k posts. Sure you may find something interesting along your line of thought
Re: Coding Help
1012Hello master mladen & all others,mladen wrote: Tue Feb 14, 2017 12:03 am Decided to keep this subject as a section, not as a single thread.
I think that this way we can have cleaner overview and state of coding issues and help (which will, eventually, help more than one single thread will all the issues - harder to find, at the lest then seeing issue short description in the thread name ...)
___________________________
So I would like to suggest it as a kind of a standard :
the thread name should have a short, but descriptive name that describes well enough the codding issue
First, Thank you so much master mladen for sharing lots of cool indis
...im quite new to FX & Coding mql4.
I find the "averages - mtf - alerts 9.1.ex4" so cool & want to get signals from this indi by iCustom call.
in fact ... Im testing this by writting an indi to visualize the signals again & check with the signals generated by the "averages - mtf - alerts 9.1.ex4" ... But things are not good, my signals ( yellow & blue arrows) doesnt match the original signals (red & green dots) ?
is that im calling wrong buffer or sending wrong parameters? please help
attached is my code & an image to better describe my problem.
Code: Select all
// Test_iCustom_Signal
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Gold
//
#define NAME "averages - mtf - alerts 9.1"
//
extern int TimeFrame = 1440;
extern int barstotest = 100;
//
double CrossUp[];
double CrossDown[];
//-----------------
int OnInit()
{
//---- indicators
SetIndexStyle (0, DRAW_ARROW, EMPTY, 1);
SetIndexArrow (0, 233);
SetIndexBuffer (0, CrossUp);
SetIndexStyle (1, DRAW_ARROW, EMPTY, 1);
SetIndexArrow (1, 234);
SetIndexBuffer (1, CrossDown);
//----
return(INIT_SUCCEEDED);
}
//-----------------
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
int limit, i, counter, counted_bars=prev_calculated;
double Range, AvgRange, I, II, III;
//---- check for possible errors
if(rates_total<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=rates_total-counted_bars;
if (barstotest>0) limit = MathMin(limit,barstotest);
//
for(i = limit; i >=0; i--) {
//
counter=i;
Range=0;
AvgRange=0;
for (counter=i ;counter<=i+9;counter++) {
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;
/////////////////////////////////////////////////////////
//sending parameters: (...,0,0,14,0,13,...) == (...,current timeframe, not use custom timeframe, average period=14, mode price_close=10, SMA = 13,...)
I = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2, i);
II = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2,i+1);
III = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2,i+2);
//////////////////////////////////////////////////////////
// Buy Arrows
CrossUp[i] = EMPTY_VALUE;
if ((I > II) && (II < III)) CrossUp[i] = Low[i] - Range*1;
else CrossUp[i] = EMPTY_VALUE;
// Sell Arrows
CrossDown[i] = EMPTY_VALUE;
if ((I < II) && (II > III)) CrossDown[i] = High[i] + Range*1;
else CrossDown[i] = EMPTY_VALUE;
}
//
return(rates_total);
}
aphong,
Re: Coding Help
1013Don't have the code for version 9.1 but have it for version 9.0 but can't remember what was different in 9.1 anyway sorry don't know.aphong wrote: Mon Jul 22, 2019 2:15 am
Hello master mladen & all others,
First, Thank you so much master mladen for sharing lots of cool indis
...im quite new to FX & Coding mql4.
I find the "averages - mtf - alerts 9.1.ex4" so cool & want to get signals from this indi by iCustom call.
in fact ... Im testing this by writting an indi to visualize the signals again & check with the signals generated by the "averages - mtf - alerts 9.1.ex4" ... But things are not good, my signals ( yellow & blue arrows) doesnt match the original signals (red & green dots) ?
is that im calling wrong buffer or sending wrong parameters? please help
attached is my code & an image to better describe my problem.
thanks in avance!Code: Select all
// Test_iCustom_Signal #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Gold // #define NAME "averages - mtf - alerts 9.1" // extern int TimeFrame = 1440; extern int barstotest = 100; // double CrossUp[]; double CrossDown[]; //----------------- int OnInit() { //---- indicators SetIndexStyle (0, DRAW_ARROW, EMPTY, 1); SetIndexArrow (0, 233); SetIndexBuffer (0, CrossUp); SetIndexStyle (1, DRAW_ARROW, EMPTY, 1); SetIndexArrow (1, 234); SetIndexBuffer (1, CrossDown); //---- return(INIT_SUCCEEDED); } //----------------- int OnCalculate(const int rates_total, const int prev_calculated, const datetime& time[], const double& open[], const double& high[], const double& low[], const double& close[], const long& tick_volume[], const long& volume[], const int& spread[]) { int limit, i, counter, counted_bars=prev_calculated; double Range, AvgRange, I, II, III; //---- check for possible errors if(rates_total<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=rates_total-counted_bars; if (barstotest>0) limit = MathMin(limit,barstotest); // for(i = limit; i >=0; i--) { // counter=i; Range=0; AvgRange=0; for (counter=i ;counter<=i+9;counter++) { AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]); } Range=AvgRange/10; ///////////////////////////////////////////////////////// //sending parameters: (...,0,0,14,0,13,...) == (...,current timeframe, not use custom timeframe, average period=14, mode price_close=10, SMA = 13,...) I = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2, i); II = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2,i+1); III = iCustom(NULL,TimeFrame,NAME,0,0,14,0,13, 2,i+2); ////////////////////////////////////////////////////////// // Buy Arrows CrossUp[i] = EMPTY_VALUE; if ((I > II) && (II < III)) CrossUp[i] = Low[i] - Range*1; else CrossUp[i] = EMPTY_VALUE; // Sell Arrows CrossDown[i] = EMPTY_VALUE; if ((I < II) && (II > III)) CrossDown[i] = High[i] + Range*1; else CrossDown[i] = EMPTY_VALUE; } // return(rates_total); }
aphong,
Re: Coding Help
1014... Hi mrtools.mrtools wrote: Mon Jul 22, 2019 5:19 am
Don't have the code for version 9.1 but have it for version 9.0 but can't remember what was different in 9.1 anyway sorry don't know.
Great to see your support!
...yep! I think ... changing to use version 9.0 would be a better choice.
Could you share the mq4 file of version 9.0? is it possible to have the source code please? :P
have a good day sir!
Re: Coding Help
1015No sorry.aphong wrote: Mon Jul 22, 2019 12:19 pm
... Hi mrtools.
Great to see your support!
...yep! I think ... changing to use version 9.0 would be a better choice.
Could you share the mq4 file of version 9.0? is it possible to have the source code please? :P
have a good day sir!
Re: Coding Help
1016Thanks mrtools! ... I know it could be imposible to have the mq4 file! ...
honestly, Im studying mql4 ... really want to know some great knowledge ... like formulas of some Averaging Methods, or what is a Quadratic Interpolation? is it repainting? or how to create the standard deviation envelops ? ... If you know where there are Public source codes of things like these on FS ... please direct me to right place for studying?
Have a good day All!
Re: Coding Help
1017Welcome to the site. There's source codes available all over this site. However, if a source code is not provided, please respect the coder's decision to protect his work from theft.aphong wrote: Mon Jul 22, 2019 1:49 pm Thanks mrtools! ... I know it could be imposible to have the mq4 file! ...
honestly, Im studying mql4 ... really want to know some great knowledge ... like formulas of some Averaging Methods, or what is a Quadratic Interpolation? is it repainting? or how to create the standard deviation envelops ? ... If you know where there are Public source codes of things like these on FS ... please direct me to right place for studying?
Have a good day All!
PS: As you are new here, we ask that you read our rules thread first before anything.
Re: Coding Help
1018Thanks JimmyJimmy wrote: Mon Jul 22, 2019 3:37 pm
Welcome to the site. There's source codes available all over this site. However, if a source code is not provided, please respect the coder's decision to protect his work from theft.
PS: As you are new here, we ask that you read our rules thread first before anything.
Re: Coding Help
1019Sure! Also, check out all the latest files in our Moving Average indicators for MT4 thread. We've been uploading lots of Mladen & Mrtools's great codes in MQL4 as standalone indicators that you can use as a starting point for your coding
Re: Coding Help
1020[quote=aphong post_id=1295392735 time=1563725719 user_id=4934567]
Hello master mladen & all others,
First, Thank you so much master mladen for sharing lots of cool indis
...im quite new to FX & Coding mql4.
I find the "averages - mtf - alerts 9.1.ex4" so cool & want to get signals from this indi by iCustom call.
in fact ... Im testing this by writting an indi to visualize the signals again & check with the signals generated by the "averages - mtf - alerts 9.1.ex4" ... But things are not good, my signals ( yellow & blue arrows) doesnt match the original signals (red & green dots) ?
is that im calling wrong buffer or sending wrong parameters? please help
attached is my code & an image to better describe my problem.
hello, the parameter 13 that you set in the iCustom function corresponds to the one in the picture is right?
Hello master mladen & all others,
First, Thank you so much master mladen for sharing lots of cool indis
...im quite new to FX & Coding mql4.
I find the "averages - mtf - alerts 9.1.ex4" so cool & want to get signals from this indi by iCustom call.
in fact ... Im testing this by writting an indi to visualize the signals again & check with the signals generated by the "averages - mtf - alerts 9.1.ex4" ... But things are not good, my signals ( yellow & blue arrows) doesnt match the original signals (red & green dots) ?
is that im calling wrong buffer or sending wrong parameters? please help
attached is my code & an image to better describe my problem.
hello, the parameter 13 that you set in the iCustom function corresponds to the one in the picture is right?