Coding help - page 736

 
vicpal69:

MT4 First / Previous Indicator's Data parameter


Hello all,

MT4 has an option on its original indicators to drag and drop. For example a MA on an indicator and choose to calculate on "first indicator's data" or "previous indicator's data"... which is very useful to make indicators get data output from other custom indicators...

My question to you coders is what should we add to an x Custom indicator code in order to have this option of calculating on "first indicator data" or "previous indicator data" so in this case we could drag and drop an x custom indicator and choose to calculate over this other custom indicator data...

Would it possible for anybody here to program this with the current MT4 build version. I'll explain it in more detail. I have two indicators attached in this message. What I would like is the indicator J_TPO (similar to Stochastic oscillator but smoother) is to get parameter values from the other customer indicator CumulativeDelta.

Let's say that I have CumulativeDelta opened. I can drag and drop the J_TPO indicator onto the CumulativeDelta indi. When the box opens where I can set the J_TPO indi's parameters, there is a place that I can tell it to "Apply to" either the "Previous Indicator's Data" or else to the "First Indicator's Data". Also included in that option are "Close, Open, High, Low, Median Price (HL/2), Typical Price (HLC/3), and Weighted Price (HLCC/4)". It seems that none of the Custom Indicators that I have seen have this option. Is such an option available for Custom Indicators?

In short simply it's a type of data exchange between two custom indis. When I drag n' drop the J_TPO onto the CumulativeDelta indi, the J_TPO data values should based on instead from the CumulativeDelta indi, not from the chart price.

I'm not a programmer/coder myself, so if I could ask a big favor when for anyone have some spare time out of their your busy life, please take a look at it if this is possible. I would really appreciate it. Cheers :D


Regards,

Victor

P.S. Here is a link that might help explain it more a technical manner with this situation. Unfortunately it's in MT5 format but I was wondering if MT4 has similar coding function variables to make this happen. Also if it's not possible with J_TPO then please take a look at another indi called Fast_Stochastic that I also attached with this message. Again thanks a lot for your time. Anyway here is the link https://www.mql5.com/en/articles/15

 

hi

How to fix error

tkanks


 

Hi Pro-Coders,

I got a error: 

check operator precedence for possible error; use parentheses to clarify precedence

 for the code below:

double trendNow=iCustom(NULL,0,"NonLagMA_v7.7",Price,MALength,Displace,PctFilter,Color,ColorBarBack,Deviation,AlertMode,WarningMode,WarningTicks,SendAlertEmail,3,BarShift);

double trendPrev=iCustom(NULL,0,"NonLagMA_v7.7",Price,MALength,Displace,PctFilter,Color,ColorBarBack,Deviation,AlertMode,WarningMode,WarningTicks,SendAlertEmail,3,BarShift+1);

      bool BUY=false;
      bool SELL=false;



if (trendNow!=trendPrev){
if(TradeAfterTP==false &&! (trendNow>0 && RSIfilter>55)||(TradeAfterTP && trendNow>0 && RSIfilter>55)) BUY=true;
if(TradeAfterTP==false &&! (trendPrev>0 && RSIfilter<45)||(TradeAfterTP && trendPrev>0 && RSIfilter<45)) SELL=true;
      }
 The compiler doesn't like the ||

What should I improve? Thank you in advance! 

 
tfi_markets:

Hi Pro-Coders,

I got a error: 

check operator precedence for possible error; use parentheses to clarify precedence

 for the code below:

double trendNow=iCustom(NULL,0,"NonLagMA_v7.7",Price,MALength,Displace,PctFilter,Color,ColorBarBack,Deviation,AlertMode,WarningMode,WarningTicks,SendAlertEmail,3,BarShift);

double trendPrev=iCustom(NULL,0,"NonLagMA_v7.7",Price,MALength,Displace,PctFilter,Color,ColorBarBack,Deviation,AlertMode,WarningMode,WarningTicks,SendAlertEmail,3,BarShift+1);

      bool BUY=false;
      bool SELL=false;



if (trendNow!=trendPrev){
if(TradeAfterTP==false &&! (trendNow>0 && RSIfilter>55)||(TradeAfterTP && trendNow>0 && RSIfilter>55)) BUY=true;
if(TradeAfterTP==false &&! (trendPrev>0 && RSIfilter<45)||(TradeAfterTP && trendPrev>0 && RSIfilter<45)) SELL=true;
      }
 The compiler doesn't like the ||

What should I improve? Thank you in advance! 

Best that you describe (using simple words not coding) what exactly are you trying to get from those conditions
 
alozard:

hi

How to fix error

tkanks


Add "return("");" before the last "}"
 
vicpal69:

MT4 First / Previous Indicator's Data parameter


Hello all,

MT4 has an option on its original indicators to drag and drop. For example a MA on an indicator and choose to calculate on "first indicator's data" or "previous indicator's data"... which is very useful to make indicators get data output from other custom indicators...

My question to you coders is what should we add to an x Custom indicator code in order to have this option of calculating on "first indicator data" or "previous indicator data" so in this case we could drag and drop an x custom indicator and choose to calculate over this other custom indicator data...

Would it possible for anybody here to program this with the current MT4 build version. I'll explain it in more detail. I have two indicators attached in this message. What I would like is the indicator J_TPO (similar to Stochastic oscillator but smoother) is to get parameter values from the other customer indicator CumulativeDelta.

Let's say that I have CumulativeDelta opened. I can drag and drop the J_TPO indicator onto the CumulativeDelta indi. When the box opens where I can set the J_TPO indi's parameters, there is a place that I can tell it to "Apply to" either the "Previous Indicator's Data" or else to the "First Indicator's Data". Also included in that option are "Close, Open, High, Low, Median Price (HL/2), Typical Price (HLC/3), and Weighted Price (HLCC/4)". It seems that none of the Custom Indicators that I have seen have this option. Is such an option available for Custom Indicators?

In short simply it's a type of data exchange between two custom indis. When I drag n' drop the J_TPO onto the CumulativeDelta indi, the J_TPO data values should based on instead from the CumulativeDelta indi, not from the chart price.

I'm not a programmer/coder myself, so if I could ask a big favor when for anyone have some spare time out of their your busy life, please take a look at it if this is possible. I would really appreciate it. Cheers :D


Regards,

Victor

P.S. Here is a link that might help explain it more a technical manner with this situation. Unfortunately it's in MT5 format but I was wondering if MT4 has similar coding function variables to make this happen. Also if it's not possible with J_TPO then please take a look at another indi called Fast_Stochastic that I also attached with this message. Again thanks a lot for your time. Anyway here is the link https://www.mql5.com/en/articles/15

MT4 custom indicator can not be applied to previous indicator. Only MT5 can
 
mladen:
Add "return("");" before the last "}"

hi

Thanks mladen

how to color fibo line code?



 
mladen:
Best that you describe (using simple words not coding) what exactly are you trying to get from those conditions

Hi Mladen,

thank you for your response. What I actually wanted to achieve was EA should stop trading in Trend Direction when

take profit event took place. I was able so simplyfly it by just looking to Signal Cross Event, so the EA is trading and

taking profit in trend direction. ;-)

 

May I ask you another question? Is there an indicator you may recommend for trading?

It could be also a commercial one. I know a "stupid" generic question, maybe you have an advise, since you are a master coder.

Thank you. 

 
alozard:

hi

Thanks mladen

how to color fibo line code?



In metatrader 4 you can not set the individual colors of each fibo line
 
mladen:
MT4 custom indicator can not be applied to previous indicator. Only MT5 can


Hello mladen sir :D Thank you for the response. I appreciate it. Check out this link https://www.mql5.com/en/forum/152520

The guy there states "Make a new indicator from the "applied to" indicator code and replace its "get price" logic with iCustom/iMA/etc. of the "previous indicator"."

Another link about iCustom function in MT4 https://docs.mql4.com/indicators/icustom

iCustom is from the group of Technical Indicator Functions that supposedly calculates the specified custom indicator and returns its value.

Or possibly just by coding a totally new custom indicator with J_TPO or Fast Stochastic values that uses the other custom indicator CumulativeDelta instead of the price.

Maybe this can bypass the apply to previous indicator function that's only in MT5.

Would this be possible or even makes sense mladen sir?


Please shed some light on this with your programming wisdom. Thank you very much :D

Reason: