Is there a possibility to set up the StoppLoss, so that it won't react unless the course closes at least twice under(over) it.
The problem is, that there are sometimes Bars that giving a unwilling Signal. I want to filter them out.
A StopLoss is a StopLoss if it is not react to the price it is set then you can't call it StopLoss
you can check the bars after opening trade (or certain bar) the closeprice if the closeprice of bar 1 is for second time lower then some value then close the trade
Is there a possibility to set up the StoppLoss, so that it won't react unless the course closes at least twice under(over) it.
The problem is, that there are sometimes Bars that giving a unwilling Signal. I want to filter them out.
You can manually code the stop loss into the OrderSelect() loop:
bool StopOnce; int barsAtStop if(Bid <= StopLoss && StopOnce == false) { StopOnce = true; //this is the first time it crosses barsAtStop = Bars; } if(Bid <= StopLoss && StopOnce == true && barsAtStop != Bars) { OrderClose(...) }
Remember to reset your StopOnce variable when there are no trades:
if(!OrderSelect()) StopOnce == false; //also remember that StopOnce has to be declared on a global scale.
. . . and bear in mind if your PC crashes or you lose internet connectivity you will have no control of closing orders . . . . . and you will have orders running with no SL.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Is there a possibility to set up the StoppLoss, so that it won't react unless the course closes at least twice under(over) it.
The problem is, that there are sometimes Bars that giving a unwilling Signal. I want to filter them out.