1 (edited by muplayer2000 2015-07-21 22:56:45)

Topic: Reverse buy and sell

Where in the the generated EA code line , when a signal is generated to execute an order can i change from a buy to a sell and a sell to a buy?

That way  buys become sells, and sells becomes buys.

Re: Reverse buy and sell

Reverse the logic (losing strategies will still lose).

3 (edited by muplayer2000 2015-07-21 23:48:39)

Re: Reverse buy and sell

My intention is not a reverse strategy, but using a combination of hedging and cross multi-currency basket, i am using the ea signals excuted order reverse buy and sell for another purpose in correlation with another EA.

I do not want to reverse the logic, just the orders Buy/Sell while keep the same entry signal . The reverse orders B >S are using more like indicators i just need them represented .

footon wrote:

Reverse the logic (losing strategies will still lose).

Re: Reverse buy and sell

If an expert executes a short entry instead of a long entry, its logic will fall apart.

You can test it but we do not guarantee any results you may expect.



For MetaTrader 4

Search for bool ActionTrade4::SendOrder
Add 2 lines below it just after the first opening curly bracket:

   type=(type==OP_BUY)?OP_SELL:OP_BUY;


For MetaTrader 5

Search for request.type
Change the found line from:

         request.type         = (type==OP_BUY)?ORDER_TYPE_BUY:ORDER_TYPE_SELL;

To

         request.type         = (type==OP_BUY)?ORDER_TYPE_SELL:ORDER_TYPE_BUY;

Re: Reverse buy and sell

In most cases reversing the logic means reversing the signal, I assume it is not hard for you to mark one bar and check it in both logic cases, whether it works for your strat or not, should take less than 30 seconds...

muplayer2000 wrote:

My intention is not a reverse strategy, but using a combination of hedging and cross multi-currency basket, i am using the ea signals excuted order reverse buy and sell for another purpose in correlation with another EA.

I do not want to reverse the logic, just the orders Buy/Sell while keep the same entry signal . The reverse orders B >S are using more like indicators i just need them represented .

footon wrote:

Reverse the logic (losing strategies will still lose).

Re: Reverse buy and sell

Thank you Footon and Popov