I did have a play about with the up_dn part but that stopped it from picking up any conditions.
Perhaps it this, could it be causng a bias for just pivots higher than the current price:
double PivotLine(string nm){ if(nm==""){double dst=1000000,piv=0; for(int i=2;i<8;i++){ if(MathAbs(Close[0]-pivot[i])<dst){ dst = MathAbs(Close[0]-pivot[i]); piv = pivot[i]; } } return(piv);
Thanks
Antony

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
Hi
I have been setting up my first EA with the help of a more experienced coder.
One condition of mt trades is that if the price is X amount from the nearest pivot line then it will invalidate the possible trade.
This is working for long trades, so if the price was too close to a pivot line above then it will invalidate and this is working.
But if there is to be a possible short trade, then the EA doesn't shows in the comments that there next pivot down is not too close but evidentially it is.
Here is some of the coding:
Thank you
Antony