![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Maybe someone else will look at your code, I'm not in the state it's in.
no problem buddy ,enjoy your weekend , i am not in a rush.
many thanks!!
every thing seems to be ok white the code,but unexpected result (its closing the sell order permanently ) i do not understand the logic is :delete the order sell _stop only if ask> pend(H+P+Spread) , i have no idea whats want wrong.
Is this meant as a function: pend(H+P+Spread)? If yes, where is it? If no, what is it? Or have you defined 'pend' as static var somewhere else?
Is this meant as a function: pend(H+P+Spread)? If yes, where is it? If no, what is it? Or have you defined 'pend' as static var somewhere else?
hi kronin
pend = (H+P+Spread);
it is a global variable .
hi kronin
pend = (H+P+Spread);
it is a global variable .
No, it isn't. You defined it inside the start function.
ticket2 is overwritten with 0 on the next tick. Either you have to place it in global scope, or you have to select it again in the ClosePendingOrder() function (Select by position and filter for something you identify your order).
And read about timeseries. The second parameter is not intended to be NULL.
No, it isn't. You defined it inside the start function.
ticket2 is overwritten with 0 on the next tick. Either you have to place it in global scope, or you have to select it again in the ClosePendingOrder() function (Select by position and filter for something you identify your order).
And read about timeseries. The second parameter is not intended to be NULL.
the compiler do not let me to put statement on the global scop so..?were do i put the "pend" so the function could read it properly ?
the compiler do not let me to put statement on the global scop so..?were do i put the "pend" so the function could read it properly ?
Declare it globally, assign it anywhere you like, just do it before you call the function . . . and remove the same variable declared as part of the function declaration.
Change this
to this
Which ticket2 do you want to use in your function ? the globally declared one or the locally declared one ? ?
Declare it globally, assign it anywhere you like, just do it before you call the function . . . and remove the same variable declared as part of the function declaration.
Change this
to this
Which ticket2 do you want to use in your function ? the globally declared one or the locally declared one ? ?
"Which ticket2 do you want to use in your function ? the globally declared one or the locally declared one ? ?"
i been checked them bout , it give the seem effect which is do not working properly (it does not close the sell order once the buy order get hit)
*i did modify the function according to your example .
any advice?
thanks.
Sort your indenting and braces into some coherent and consistent style and you will probably see where your issue is.
And read about timeseries. The second parameter is not intended to be NULL.
You have been given plenty of advice, you don't seem to want to take it though.
Sort your indenting and { } braces and fix your timeseries calls.
You have been given plenty of advice, you don't seem to want to take it though.
Sort your indenting and { } braces and fix your timeseries calls.
what i am missing here:
*i change the code to be more clear .
it doesnt close the pending sell once the buy order hit!
i am lost!
Which ticket2 do you want to use in your function ? the globally declared one or the locally declared one ? ?
ticket and ticket2 are globally declared, you don't need to pass then when you call the function . . .
change these
to these