Page 128 of 180

Re: Coding Help

Posted: Tue Aug 31, 2021 5:45 am
by Jackson Doh
mrtools wrote: Tue Aug 31, 2021 5:06 am Try this one.
Thank you so much Mr Tools. That is perfect.

It is also appreciated that I could compare it to the original in DiffMerge. While I guessed CleanPoint had some bearing after looking at your recent Momentum Histo and/ or Alb Speed MA fixes, I didn't catch any of the PlotPoint or the changes that were made.

Re: Coding Help

Posted: Tue Aug 31, 2021 5:57 am
by mrtools
Jackson Doh wrote: Tue Aug 31, 2021 5:45 am Thank you so much Mr Tools. That is perfect.

It is also appreciated that I could compare it to the original in DiffMerge. While I guessed CleanPoint had some bearing after looking at your recent Momentum Histo and/ or Alb Speed MA fixes, I didn't catch any of the PlotPoint or the changes that were made.
Those functions (CleanPoint & PlotPoint), are for non repainting line type indicators.

Re: Coding Help

Posted: Wed Sep 01, 2021 6:33 pm
by Lesley919
Dear Coders, currently I am writing my EA and confused with calling custom indicators. I am going to take mrtools' TrendScalp indicator as an example.

The first question is, if the indicator has MTF, I want to call the indicator's higher timeframe value, for example calling 30 minutes value for trading 5 minutes candle, for which "Time Frame" I should enter PERIOD_M30? iCustom's int timeFrame or MTF indicator's TimeFrame or both?

Code: Select all

// 1
double value=iCustom(Symbol(),PERIOD_M30,"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_CURRENT,/*the rest of custom indicator parameters*/,bufferNumber,shift);

// 2
double value=iCustom(Symbol(),Period(),"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_M30,/*the rest of custom indicator parameters*/,bufferNumber,shift);

// 3
double value=iCustom(Symbol(),PERIOD_M30,"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_M30,/*the rest of custom indicator parameters*/,bufferNumber,shift);

The second question is, can I just only enter the yellow box parameters (shown as attached image) and ignore the rest like alert, arrows etc, shown as following:

Code: Select all

double value=iCustom(Symbol(),Period(),"Trend - scalp 1.01(mtf + arrows + alerts).ex4",				// Symbol, period, and Trend Scalp indicator name
		TimeFrame,Trend rigger factor bars,Upper level,Lower level,T3 period,T3 volume factor,T3 type,	// Yellow box Trend Scalp indicator inputs and let the rest as default
		0,1);												// Buffer number and shift

I used to test it by writing a custom indicator to call another custom indicator. It only works when I call the MT4 build-in indicators, but it doesn't work when I call the indicators that I downloaded from this forum or somewhere else. I am not a professional Coders, so if dear professional coders can address my confusion, I would appreciate it. Thank you!

Help: Trying to change width of levels

Posted: Wed Sep 01, 2021 9:16 pm
by TEAMTRADER
I am trying to change the width of the levels below and failed.
Is there an answer to changing the width of these levels or is it not possible?

extern int Fibo1LevelsStyle = STYLE_SOLID;


Thanks
TEAMTRADER

Re: Help: Trying to change width of levels

Posted: Thu Sep 02, 2021 2:35 am
by mrtools
TEAMTRADER wrote: Wed Sep 01, 2021 9:16 pm I am trying to change the width of the levels below and failed.
Is there an answer to changing the width of these levels or is it not possible?

extern int Fibo1LevelsStyle = STYLE_SOLID;


Thanks
TEAMTRADER
Should be possible unless the width is hardcoded somewhere in the code.

Re: Coding Help

Posted: Thu Sep 02, 2021 2:37 am
by mrtools
Lesley919 wrote: Wed Sep 01, 2021 6:33 pm Dear Coders, currently I am writing my EA and confused with calling custom indicators. I am going to take mrtools' TrendScalp indicator as an example.

The first question is, if the indicator has MTF, I want to call the indicator's higher timeframe value, for example calling 30 minutes value for trading 5 minutes candle, for which "Time Frame" I should enter PERIOD_M30? iCustom's int timeFrame or MTF indicator's TimeFrame or both?

Code: Select all

// 1
double value=iCustom(Symbol(),PERIOD_M30,"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_CURRENT,/*the rest of custom indicator parameters*/,bufferNumber,shift);

// 2
double value=iCustom(Symbol(),Period(),"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_M30,/*the rest of custom indicator parameters*/,bufferNumber,shift);

// 3
double value=iCustom(Symbol(),PERIOD_M30,"Trend - scalp 1.01(mtf + arrows + alerts).ex4",
				PERIOD_M30,/*the rest of custom indicator parameters*/,bufferNumber,shift);

The second question is, can I just only enter the yellow box parameters (shown as attached image) and ignore the rest like alert, arrows etc, shown as following:

Code: Select all

double value=iCustom(Symbol(),Period(),"Trend - scalp 1.01(mtf + arrows + alerts).ex4",				// Symbol, period, and Trend Scalp indicator name
		TimeFrame,Trend rigger factor bars,Upper level,Lower level,T3 period,T3 volume factor,T3 type,	// Yellow box Trend Scalp indicator inputs and let the rest as default
		0,1);												// Buffer number and shift

I used to test it by writing a custom indicator to call another custom indicator. It only works when I call the MT4 build-in indicators, but it doesn't work when I call the indicators that I downloaded from this forum or somewhere else. I am not a professional Coders, so if dear professional coders can address my confusion, I would appreciate it. Thank you!
To both questions yes.

Re: Help: Trying to change width of levels

Posted: Thu Sep 02, 2021 7:24 am
by TEAMTRADER
mrtools wrote: Thu Sep 02, 2021 2:35 am Should be possible unless the width is hardcoded somewhere in the code.
I thought it would be easy by just putting a '2' after the 'SOLID' but that did not work.
Then I tried many variations of 'levels_width' and 'style_widths' but nothing has worked.
Is there a special code that I can enter that can change the levelsStyle width?
This is the block of code that I refer to with the one in bold that I would like to change.

extern color Fibo3Color = clrBlack;
extern int Fibo3Width = 1;
extern int Fibo3Style = STYLE_DOT;
extern int Fibo3LevelsStyle = STYLE_SOLID;
Thanks
TEAMTRADER

Re: Coding Help

Posted: Thu Sep 02, 2021 6:36 pm
by Lesley919
mrtools wrote: Thu Sep 02, 2021 2:37 am To both questions yes.
Thank you so much!

Re: Coding Help

Posted: Wed Sep 08, 2021 12:23 pm
by Jackson Doh
Dear Mr Tools,
I came across the Fast_Ema_Hull.mq4 indicator on the mql5 site. It is similar to the one Darks issued on here last year. I decided to try to do some upgrades to it so there's now a version with an on/off button and alerts, which appears to work just fine. I have also created a histo version but I've got a similar problem like with the Step Jurik in that this time there's repainting as the signal goes from sell to buy. There's no CleanPoint or PlotPoints to change so I'm out of my depth again. Would you mind having a look at the attached histo please and fix the coding error?

I am attaching the original file from mql5, the completed on/off button version that I made along with the problematic histo version.

Many thanks
Edit: I just noticed the alerts don't work on the button. I hashed out the trend index and didn't correct it.

Re: Coding Help

Posted: Wed Sep 15, 2021 5:00 am
by wojtek
Interesting indicators, but unfortunately the colours repaint in the main version (the line in the chart window)...
The histo version doesn't work properly, too.