Hi everyone,
I spent 3 weeks to create a custom indicator but clearly Im not good enough, hoping someone can help.
The prupose of this simply indicator is to group RS like we draw RS in chart manaully base on multiple top or bottom. Im hoping to use this indicator to display most recent RS for my scapling EA later on. Most fractal RS indicator only display 2 RS level for each time frame. Mine is to display all combined level(most importantly in M15 where my EA will run).
My indicator take 3 extern: "Timeframe", "number of display level on chart" and "min distance between each level".
All i need to code is to group, remove fractal point within min distance and then display the remaining fractal point level.
The first version(MainRS_AddOn2.mq4) i created do exactly what i want, however i use stupid method by drawing object and keep modify object, the indicator run extremely slow.
The second version(17_8_2020_RS_Indicator.mq4) store all level in buffer which run a lot faster, but i got issues which im not able fix.
----i believe i have logical error in storing new fractal level, which some display level didnt met the min distance requirement and got more duplicate level when run in tester.
https://c.mql5.com/3/329/4418339092467__1.png
left side is 17_8_2020_RS_Indicator.mq4, which have duplicated level.
https://c.mql5.com/3/329/3446411664519__1.png
Above is duplicate level inside tester.
//--------------------------------------------------------------------------------------------
if(modify == false)// store new level when display level limit have no more room
{
if(RSMode[limit]==1)
{
int index = ArrayMinimum(Display_level,WHOLE_ARRAY,0);
Display_Mode[index]=RSMode[limit] ;
Display_level[index]=RSBuffer1[limit];
}
if(RSMode[limit]==2)
{
int index = ArrayMaximum(Display_level,WHOLE_ARRAY,0);
Display_Mode[index]=RSMode[limit] ;
Display_level[index]=RSBuffer1[limit];
}
modify =true;
}
//---------------------------------------------------------------------------------------------------------------------
Im thinking the above code may cause the logical error. But nobody can tell unless they willing to spend time to look into whole file.
Hoping anyone can help/teach or improve.
Greatly appreciated. Below is the complete code, you are welcome to copy and paste or download the attached file.
Many thanks.
I spent 3 weeks to create a custom indicator but clearly Im not good enough, hoping someone can help.
The prupose of this simply indicator is to group RS like we draw RS in chart manaully base on multiple top or bottom. Im hoping to use this indicator to display most recent RS for my scapling EA later on. Most fractal RS indicator only display 2 RS level for each time frame. Mine is to display all combined level(most importantly in M15 where my EA will run).
My indicator take 3 extern: "Timeframe", "number of display level on chart" and "min distance between each level".
All i need to code is to group, remove fractal point within min distance and then display the remaining fractal point level.
The first version(MainRS_AddOn2.mq4) i created do exactly what i want, however i use stupid method by drawing object and keep modify object, the indicator run extremely slow.
The second version(17_8_2020_RS_Indicator.mq4) store all level in buffer which run a lot faster, but i got issues which im not able fix.
----i believe i have logical error in storing new fractal level, which some display level didnt met the min distance requirement and got more duplicate level when run in tester.
https://c.mql5.com/3/329/4418339092467__1.png
left side is 17_8_2020_RS_Indicator.mq4, which have duplicated level.
https://c.mql5.com/3/329/3446411664519__1.png
Above is duplicate level inside tester.
//--------------------------------------------------------------------------------------------
if(modify == false)// store new level when display level limit have no more room
{
if(RSMode[limit]==1)
{
int index = ArrayMinimum(Display_level,WHOLE_ARRAY,0);
Display_Mode[index]=RSMode[limit] ;
Display_level[index]=RSBuffer1[limit];
}
if(RSMode[limit]==2)
{
int index = ArrayMaximum(Display_level,WHOLE_ARRAY,0);
Display_Mode[index]=RSMode[limit] ;
Display_level[index]=RSBuffer1[limit];
}
modify =true;
}
//---------------------------------------------------------------------------------------------------------------------
Im thinking the above code may cause the logical error. But nobody can tell unless they willing to spend time to look into whole file.
Hoping anyone can help/teach or improve.
Greatly appreciated. Below is the complete code, you are welcome to copy and paste or download the attached file.
Many thanks.