HI,Can some solve my problem please find the attach .Actaully what i m trying to do is to print the horizontal line and if you see the image it does print the line but i want to print the line on the same point when cross occur and another thing and also i don't want lines when there is no cross if you see there is line happenning whenever there is no cross occur so i have to remove that thing also can somebody help me to solve this issues
- My EA does buy and sell automatically when I backtest it is there anyone that can help me to solve this issue?
- Want to print the horizontal lines at some distance level
- Please fix this indicator or EA
ankityadav: need a horizontal lines when ever the two line crosses each other a
if(fastsma>=slowsma)
You check for fast above or below slow, not a cross of fast and slow | double fastsma=iBands(NULL,0,InpFastSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit); double slowsma =iBands(NULL,0,InpSlowSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit); ExtBuffer1[limit]=fastsma; ExtBuffer2[limit]=slowsma; if(fastsma>=slowsma) |
You want a line when they cross. | double fastsma=iBands(NULL,0,InpFastSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit); double slowsma =iBands(NULL,0,InpSlowSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit); ExtBuffer1[limit]=fastsma; ExtBuffer2[limit]=slowsma; double fastPre=iBands(NULL,0,InpFastSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit+1), slowPre=iBands(NULL,0,InpSlowSMA,Inpdev,0,PRICE_CLOSE,MODE_SMA,limit+1); bool wasAbove = fastPre > slowPre, isAbove = fastsma > slowsma, isCross = wasAbove != isAbove; if(isCross){ test for a cross if(fastsma>=slowsma) : // else if(fastsma<=slowsma) unnecessary test removed else : } |
ankityadav: i want to see only lines in past 50 bars what i need to use.T
a trend line instead of a hline
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