aransier: . i wrote as Murr_buy != EMPTY_VALUE
-
Play videoPlease edit your post.
For large amounts of code, attach it. - Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
- Lot size must also be adjusted to a multiple of LotStep. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
- Drop the Normalize and the compare may work.
- Print out your variables, and find out why.
aransier:
Hello everyone, i am having some trouble getting my EA to confirm a buy signal on Value 4 (green) and sell Value 8 (red)
double Murr_buy=NormalizeDouble(iCustom(NULL,0,"Murreys_Math_oscillator",Length,3,1),5);
double Murr_sell=NormalizeDouble(iCustom(NULL,0,"Murreys_Math_oscillator",Length,7,1),5);
This is the indicator part. i wrote as Murr_buy != EMPTY_VALUE
...Thank you for your help in advance
"Murreys_Math_oscillator" indicator does not use EMPTY_VALUE for those cases. It uses 0
OP2[pos]=0.; OP3[pos]=0.; OP4[pos]=0.; ON1[pos]=0.; ON2[pos]=0.; ON3[pos]=0.; ON4[pos]=0.;
Compare it to 0, and it should work
whroeder1:
Thank you so much .
-
Please edit your post.
For large amounts of code, attach it. -
- Drop the Normalize and the compare may work.
- Print out your variables, and find out why.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone, i am having some trouble getting my EA to confirm a buy signal on Value 4 (green) and sell Value 8 (red)
double Murr_buy=NormalizeDouble(iCustom(NULL,0,"Murreys_Math_oscillator",Length,3,1),5);
double Murr_sell=NormalizeDouble(iCustom(NULL,0,"Murreys_Math_oscillator",Length,7,1),5);
This is the indicator part. i wrote as Murr_buy != EMPTY_VALUE
#property indicator_buffers 8
#property indicator_color1 clrLime
#property indicator_color2 clrSpringGreen
#property indicator_color3 clrLimeGreen
#property indicator_color4 clrGreen
#property indicator_color5 clrSaddleBrown
#property indicator_color6 clrChocolate
#property indicator_color7 clrTan
#property indicator_color8 clrRed
extern int Length=100;
extern double Multiplier=0.125;
extern bool Show_Lines=true;
double OP1[], OP2[], OP3[], OP4[], ON1[], ON2[], ON3[], ON4[];
int init()
{
IndicatorShortName("Murreys Math oscillator");
IndicatorDigits(Digits);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,OP1);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1,OP2);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(2,OP3);
SetIndexStyle(3,DRAW_HISTOGRAM);
SetIndexBuffer(3,OP4);
SetIndexStyle(4,DRAW_HISTOGRAM);
SetIndexBuffer(4,ON1);
SetIndexStyle(5,DRAW_HISTOGRAM);
SetIndexBuffer(5,ON2);
SetIndexStyle(6,DRAW_HISTOGRAM);
SetIndexBuffer(6,ON3);
SetIndexStyle(7,DRAW_HISTOGRAM);
SetIndexBuffer(7,ON4);
if (Show_Lines)
{
SetLevelValue(0, 2.*Multiplier);
SetLevelValue(1, 4.*Multiplier);
SetLevelValue(2, 6.*Multiplier);
SetLevelValue(3, 8.*Multiplier);
SetLevelValue(4, -2.*Multiplier);
SetLevelValue(5, -4.*Multiplier);
SetLevelValue(6, -6.*Multiplier);
SetLevelValue(7, -8.*Multiplier);
}
Thank you for your help in advance