Why does a increase in value but not trigger the following if function?
Why does a increase in value but not trigger the following if function?
Loading saved threads...
Ludwig · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Ludwig
Original post: https://stackoverflow.com/questions/67332306
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
So I am trying to identify a certain pattern by splitting it into 2 parts a and b. the ea is able to find the a but fails to proceed and run b.
double EMA77 = iMA(NULL,5,77,0,1,PRICE_CLOSE,1);
double EMA9 = iMA(NULL,5,9,0,1,PRICE_CLOSE,1);
double NEMA77 = NormalizeDouble(EMA77,5);
double NEMA9 = NormalizeDouble(EMA9,5);
if(NEMA9 > NEMA77){
a = a+1;
Alert(a + " a value");
}
if(a>0 && NEMA77==NEMA9){
b = b+1;
Alert(b + "b value");
}
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External question — Stack Overflow Stack Exchange Author: Ludwig Source score (net votes, not local likes): 0 Original post: https://stackoverflow.com/questions/67332306 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. So I am trying to identify a certain pattern by splitting it into 2 parts a and b. the ea is able to find the a but fails to proceed and run b. double EMA77 = iMA(NULL,5,77,0,1,PRICE_CLOSE,1); double EMA9 = iMA(NULL,5,9,0,1,PRICE_CLOSE,1); double NEMA77 = NormalizeDouble(EMA77,5); double NEMA9 = NormalizeDouble(EMA9,5); if(NEMA9 > NEMA77){ a = a+1; Alert(a + " a value"); } if(a>0 && NEMA77==NEMA9){ b = b+1; Alert(b + "b value"); }
Checking account access…