Wouldn't someone advise me where I'm making a mistake, I'm already involved. Thank you
- Your code is:
if (condition) { else if(condition2) }
Isn't it obvious?
-
if ( (LongFilter==true
You should be able to read your code out loud and have it make sense. You would never write if( (2+2 == 4) == true) would you? if(2+2 == 4) is sufficient. So don't write if(bool == true), just use if(bool) or if(!bool). Code becomes self documenting when you use meaningful variable names, like bool isLongEnabled where as Long_Entry sounds like a trigger price or a ticket number and “if long entry” is an incomplete sentence.
- Don't copy and paste code, that's unreadable.
Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code.
unreadable.
if ( (LongFilter==true&&TimeFrame==Weekly&&(iHigh(0,PERIOD_W1,0)-iLow(0,PERIOD_W1,0))>Range*point&&Bid<WPL&& YL== 1&&iLow(0,PERIOD_W1,0)<iLow(0,PERIOD_W1,1))|| (LongFilter==true&&TimeFrame==Daily&&(iHigh(0,PERIOD_D1,0)-iLow(0,PERIOD_D1,0))>Range*point&&Bid<MPL&& YL== 1&&iLow(0,PERIOD_D1,0)<iLow(0,PERIOD_D1,1)) )
Simplify double wkH0=iHigh(0,PERIOD_W1,0), wkL0= iLow(0,PERIOD_W1,0), wkL1= iLow(0,PERIOD_W1,1); bool isRange = wkH0-wkL0 > Range*point, isDnTrend = wkL0 < wkL1 double sellLevel = TimeFrame==Weekly ? WPL : MPL; boool isBelow = Bid < sellLevel; if (LongFilter && isRange && isBelow && YL== 1 && isDnTrend)
Thank you, it's not my code in the past I had it written and now I'm trying to edit it
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