Re: Coding Help

761
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

762
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.
These users thanked the author mrtools for the post:
thiru

Re: Coding Help

764
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

765
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

767
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

768
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

769
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.


Who is online

Users browsing this forum: No registered users and 21 guests