Spécifications
I would like a software ReversalIndicators.ex4 that I have and can attach to work in Autotrading as an expert advisor. Anyone can help?
In summary Expert advisor to do the following:
1. Have an input start of day time for trading (I set a variable time?)
2. Have an end of day close time variable for trading (I set a variable time?)
3. Close open order for symbol at close of day time (don’t leave order live to avoid gaps)
4. Variable lot size option 0.01 to 10
5. If Reversal Indicator software = Blue indicator buy market order
6. a stop loss at the bottom of the candle stick it indicates (is it possible to add a variable pip stop loss to move away from the candlestick?)
7. + a target price of say 20 pips from just open order a variable or off option might be a better solution.
8. If Reversal Indicator software = RED indicator Sell market order with a stop loss at the bottom of the candle stick it indicates (is it possible to add a variable pip stop loss to move away from the candlestick?)
9. + a target price of variable or off option in pips from just open order
10. If an order is open and a new indicator (Red or Blue) is calculated close open order and open new order with parameters of 5 to 8
11. Activate EA true / False
12. Slippage Value 3
13. Max positions 1
14. Trailing stop
Eg:
input double Lot = 1; (or Variable)
input int TakeProfit = 20; (or Variable)
input int StopLoss = 10; (or Variable)
input int TrailingStop = 150; (or Variable or off)
input int Slippage = 3;
input int MaxOrders = 1;
input int Magic = 666;
input int PERIOD = 15; (or Variable)
input int MaxSpread = 5; (or Variable)
Would also like the following code as an example added to minimize losses for any pair selected.
extern string EnterBEPips = "Please Enter profit pips to move SL to BE.";
extern double BE_Pips = 10; (or Variable or off)
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if(Symbol()=="USDJPY" || Symbol()=="EURJPY" || Symbol()=="GBPJPY")
return(0);
int type;
int ticket;
int total = OrdersTotal();
double openPrice, stopPrice;
for(int i=total-1;i>=0;i--)
{
for(int j=i;j>=0;j--)
if(OrderSelect(i, SELECT_BY_POS))
{
ticket = OrderTicket();
type = OrderType();
openPrice = OrderOpenPrice();
stopPrice = OrderStopLoss();
if(type == OP_SELL && stopPrice > openPrice && Ask<= (openPrice-BE_Pips*0.0001) && OrderSymbol()==Symbol())
OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);
else if(type == OP_BUY && stopPrice < openPrice && Bid>= (openPrice+BE_Pips*0.0001)&& OrderSymbol()==Symbol() )
OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Blue);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Let me know if this covers it. Thanks!