I removed your code . . . .
Please edit your post above and re-insert your code using the SRC button . . . please use the SRC button to post code: How to use the SRC button.
To edit your post . . .
Ok, thanks.
Ok, thanks.
Hedging isn't allowed in US. ERR_TRADE_HEDGE_PROHIBITED You do realize you pay the spread twice but can not profit?
I am sorry to know about it isn't allowed in US.
But as I can do it on my broker and MT4 allows it as well, I guess it is ok to discuss it here.
Yes, I would pay the spread twice, but it would diminish my drawdown and/or the negative equity from some negative orders, right? It is part of the strategy I am testing.
Anyway, I don't use it, let's assume it is just for programming learning purposes, ok? ;-)
I've just updated the code that was removed from the first post.
Can someone help?
Thanks.
- Closing a negative order does the same without two spreads.
order[i] = OrderSelect(b,SELECT_BY_POS);
RTFM what does OS() return?
- Closing a negative order does the same without two spreads.
- RTFM what does OS() return?
Of course, terrible mistake.
I wonder if it would work using:
if (order[n] != OrderTicket())
But, i am not getting to run through all array values to check for existing order because of error:
"Incorrect start position 0 for ArrayMaximum function".
for (int n = ArrayMaximum(order); n >= 0; n--) { if (order[n] != OrderTicket() ) // check whether the order already have an opposite order opened (flawed)
Any tips?
How about my logic? (saving the order ticket in an array for posterior checking)
Would it work? Thanks.
Of course, terrible mistake.
I wonder if it would work using:
But, i am not getting to run through all array values to check for existing order because of error:
"Incorrect start position 0 for ArrayMaximum function".
Does your array still have a size of zero elements or did you change it ?
int order[];
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am willing to open an opposite order (hedge) when some opened order hits some condition, but I am in trouble getting to do it with array.
What i got so far is:
Well, I think i am not getting to register the opened orders in the array and check whether there is already an opposite order opened.
Please help.
Thanks.