Help with code

Hey,

I used to program years ago, anyways I’m starting again with MetaTrader. But I was wondering if someone already had code like this because I want to use it in a strategy.

Basically, a quick command to buy and sell a currency simultaneously, two separate trades.

Each trade must have a trailing stop and a close position. So on the long trade, it’ll have a trailing stop of X and a close position below the purchase price, and visa versa for the short position.

Anyone got that ? And on an unrelated query, hedging is only illegal in certain countries right :wink: I’m not in the UK or USA and neither is my broker, haven’t found anything stopping me from playing with it.

Could you go into a little more detail? Do you want them to have the same trail, stoploss, and lot size? Do you want it to trail immediately? Do you want a take profit? I can whip it up in between trying to figure out my issue :).

And I may be wrong, but I believe that your broker has to be somewhere where there isn’t the new rules. I’m in the US and Forex.com would let me hedge.