Page 77 of 158

Re: Coding Help

Posted: Mon Jul 16, 2018 1:11 pm
by thiru
mrtools wrote: Mon Jul 16, 2018 3:35 am Added the center line with the visible/hide option also there is some asymmetrical(abands) versions around will see if I can find one.
Dear mrtools
Thank you very much for the quick one. really appreciate your help.

Tested now and looks like there is a bug. In MTF mode, it won't draw the center line. Can you check, please?


Re: Coding Help

Posted: Mon Jul 16, 2018 3:33 pm
by mrtools
thiru wrote: Mon Jul 16, 2018 1:11 pm

Dear mrtools
Thank you very much for the quick one. really appreciate your help.

Tested now and looks like there is a bug. In MTF mode, it won't draw the center line. Can you check, please?


2018-07-16 11_00_24-EURUSD,M15.png
Posted the fixed version at my original post.

Re: Coding Help

Posted: Mon Jul 16, 2018 3:41 pm
by thiru
mrtools wrote: Mon Jul 16, 2018 3:33 pm Posted the fixed version at my original post.
Dear mrtools
Thank you very much. Works like a charm

:)

Re: Coding Help

Posted: Tue Jul 17, 2018 6:04 pm
by thiru
Dear mrtools,

inspired by yours or mladens Daily Data 3.1 utility, which is specifically designed for higher TF I was thinking of something very simple for the lower time frame.

Can you please have the option for the number of bars in this mladens Custom_Candles_mtf_nmc.mq4. As I understand usually the number of bars is set to 0 for all bars.

if we can have the option to set the number of bars, then that would be perfect.

Thanks in advance.
//
//

Re: Coding Help

Posted: Tue Jul 17, 2018 7:05 pm
by uncle wong
Dear Mods and coders,

What does the below code tell us about the relationship between MACD and ADX?Thanks for help.
What is?

Code: Select all

dip>dim

Code: Select all

   for(i=limit; i>=0; i--)
   {
      double macd = iMA(NULL,0,FasterMA,0,MAMode,MAPrice,i)-iMA(NULL,0,SlowerMA,0,MAMode,MAPrice,i);
      double adx  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_MAIN,i);
      double dip  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_PLUSDI,i);
      double dim  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_MINUSDI,i);

         value[i] = 0;
            if (macd>0)                             value[i] +=1;
            if (macd<0)                             value[i] -=1;
            if (dip>dim && dip>DIValues)            value[i] +=1;
            if (dim>dip && dim>DIValues)            value[i] -=1;
            if (adx>ADXValue && dip>dim)            value[i] +=1;
            if (adx>ADXValue && dim>dip)            value[i] -=1;
            if (adx>ADXValue && adx<dip && adx>dim) value[i] +=1;
            if (adx>ADXValue && adx>dip && adx<dim) value[i] -=1;
   }
   return(0);
}

Re: Coding Help

Posted: Wed Jul 18, 2018 11:36 pm
by uncle wong
Can anyone answer this?

Re: Coding Help

Posted: Thu Jul 19, 2018 3:09 am
by mrtools
uncle wong wrote: Tue Jul 17, 2018 7:05 pm Dear Mods and coders,

What does the below code tell us about the relationship between MACD and ADX?Thanks for help.
What is?

Code: Select all

dip>dim

Code: Select all

   for(i=limit; i>=0; i--)
   {
      double macd = iMA(NULL,0,FasterMA,0,MAMode,MAPrice,i)-iMA(NULL,0,SlowerMA,0,MAMode,MAPrice,i);
      double adx  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_MAIN,i);
      double dip  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_PLUSDI,i);
      double dim  = iADX(NULL,0,ADXPeriod,ADXPrice,MODE_MINUSDI,i);

         value[i] = 0;
            if (macd>0)                             value[i] +=1;
            if (macd<0)                             value[i] -=1;
            if (dip>dim && dip>DIValues)            value[i] +=1;
            if (dim>dip && dim>DIValues)            value[i] -=1;
            if (adx>ADXValue && dip>dim)            value[i] +=1;
            if (adx>ADXValue && dim>dip)            value[i] -=1;
            if (adx>ADXValue && adx<dip && adx>dim) value[i] +=1;
            if (adx>ADXValue && adx>dip && adx<dim) value[i] -=1;
   }
   return(0);
}
In this context value +=1 is uptrend and value -= is downtrend.

Re: Coding Help

Posted: Tue Jul 24, 2018 7:51 pm
by Fabio.g
I am trying to synchronize the same indicator (WPR) over two different timeFrames.

Code: Select all

double wpr_M1 = iWPR(NULL,PERIOD_M1,14,1)
double wpr_H1 = iWPR(NULL,PERIOD_H1,14,1)
if (wpr_H1> -20 and wpr_M1 > -20)
{
executeSell
}
Now graphically that work fine, but in the EA it seems that the 2 conditions never line up. Is there a programmatic reason? Manually I get about a good signal per day. but in the EA it will not line up. the EA it is attached to a M1 chart, so I will check at the open of 11:00 bar, the previous H1 bar and 10:59 m1 bar.

thank you in advance

Re: Coding Help

Posted: Sun Jul 29, 2018 5:26 pm
by Deez
Adding Alarms

Can someone please post a snippet of code that is required to add an alarm to any indicator. For example

Variable declaration


What variables to pass into a class

What variable to return
if any

and how to alert on current candle

I know this is a bit of a generalization and coding is specific but any help will be appreciated.

Re: Coding Help

Posted: Tue Jul 31, 2018 1:40 am
by reachme
mrtools wrote: Thu Apr 12, 2018 4:19 am

Added all the averages.
Dear Mr.Tools,

can you please add Force price in this version? It was there in 1.03 but somehow it got missed in it. Thanks for your help.

Regards,
Reachme.[attachment=0]