saunga2nd:
I'm new to this code writing so there might be some things wrong with this code. However, what I'm trying to do is modify stop orders (long and shorts) that can move at the same time regardles of where price is going. As of right now on the open of the candle if will change both. But say, when it goes up one pip it will adjust above only and when it goes down past the open it will adj below and so on. Is there a way make it change and keep the same distance above and below regarldes of where the price is going? I hope I'm making sense.
keeping always the same distance from above and below? it doesn't make sense. If
you have a pending order above 10 pips from high and below 10 pips from low then
what is the point of it? it never hits because it is always running away...I'm new to this code writing so there might be some things wrong with this code. However, what I'm trying to do is modify stop orders (long and shorts) that can move at the same time regardles of where price is going. As of right now on the open of the candle if will change both. But say, when it goes up one pip it will adjust above only and when it goes down past the open it will adj below and so on. Is there a way make it change and keep the same distance above and below regarldes of where the price is going? I hope I'm making sense.
if you want to change a buy-stop as price makes new low and bring it down a little, this is different story and must programmed a little bit different as your code above...
And think why is your code changing pending orders at open a new trade -- maybe because at first moment high=low=open=close??
Sorry for the delay. It's supposed to be a breakout ea and it's missing the variable
for the time of day. The purpose of this ea is not to wander with price.
What do you mean by "... maybe because at first moment high=low=open=close??"
Do you know how to acomplish what I described?
What do you mean by "... maybe because at first moment high=low=open=close??"
Do you know how to acomplish what I described?
The way your code is structured it is kind of incomprehensible.
Maybe you meant to say:
if(cmd==OP_BUYSTOP || cmd==OP_SELLSTOP)
{
if(cmd==OP_BUYSTOP)
{
ho=h+sp+10*Point;
OrderModify(OrderTicket(),ho,0,0,0,Red);
error=GetLastError();
Print("error(",error,"): ",ErrorDescription(error));
Sleep(1000);
}
if(cmd==OP_SELLSTOP)
{
lo=l-10*Point;
OrderModify(OrderTicket(),lo,0,0,0,Red);
error=GetLastError();
Print("error(",error,"): ",ErrorDescription(error));
Sleep(1000);
}
}
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
Any help greatly appreciated