PipMaker v1 - Price action based EA - page 109

 

I think Enforcer will not kill for my answer :-)

The condition for BUY or SELL is:

If (CurrentARSI - PreviousARSI) > ARSI_Trigger

then BUY

If (PreviousARSI - CurrentARSI) > ARSI_Trigger

then SELL

 

Guys, in no mystery, is written inside EA

RSI_1 = iCustom(NULL, RSI_period,"Adaptive RSI", RSI_bars, PRICE_CLOSE, 0)*10;

RSI_2 = iCustom(NULL, RSI_period,"Adaptive RSI", RSI_bars, PRICE_CLOSE, 1)*10;

if (

RSI_1 > RSI_2 &&

RSI_1 - RSI_2 > ARSI_trigger) {tradeDirection=1;}

if (

RSI_1 < RSI_2 &&

RSI_2 - RSI_1 > ARSI_trigger) {tradeDirection=-1;}
 
Enforcer:

ProfitMode have 3 options:

2 = Will close all trades once ProfitTarget is reached.

3= Will close buys once ProfitTarget is reached by buy orders only, same goes for sells.

1= will combine 2 and 3 and will close orders on what situation came first.

but, only if ProfitTrailing is OFF!!!!

CHFJPY is cool...

// ---------------------------------- Take Profit code --------------------------------------

double TotalProfit = BuyProfit + SellProfit;

double TotalOrders = BuyOrders + SellOrders;

if(TotalProfit > MaxProfit) MaxProfit =TotalProfit;

if(TotalOrders == 0 || TotalProfit<=0)MaxProfit = 0;

//------------------------------------

if(ProfitTrailing)

{

ProfitMode=0;

if(TotalProfit >=ProfitTarget && TotalProfit <= (MaxProfit-(MaxProfit*MaxRetrace)/100))

ExitAllTrades(Lime,"Max profit reached");

}

//------------------------------------

if (ProfitMode==1 || ProfitMode==2 && BuyProfit + SellProfit >= ProfitTarget)

{

for (Order = OrdersTotal() - 1; Order >= 0; Order--)

{

if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES))

{

if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference)

{

OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, Green);

}

Error = GetLastError();

if (Error != 0) Write("Error closing order " + OrderTicket() + ": " + ErrorDescription(Error) + " (F" + Error + ") Lots:" + OrderLots() + " Ask:" + MarketInfo(OrderSymbol(), MODE_ASK));

}

}

}

//------------------------------------

if (ProfitMode==1 || ProfitMode==3)

{

if(BuyProfit>=ProfitTarget)CloseAllBuyProfit();

if(SellProfit>=ProfitTarget)CloseAllSellProfit();

}

// ----------------------------------End Take Profit code --------------------------------------

 

Correct, only without ProfitTrailing.

 

This is my new favorite EA. I'm having a great deal of fun fiddling with the trade logic with different ideas. Thank you very much Enforcer, this is an extremely well put EA.

The one thing i'm having a bit of trouble with is that this EA takes a great deal of time to backtest. Anyway we can optimize the code so that it backtests faster?

Thank you again, wonderful job.

-dgv

 

Nice backtest

Files:
pipmaker.gif  22 kb
 
frantacech:
Nice backtest

But not so nice DD

I always try to get lowest DD, not higher profit.

 
drgoodvibe:
This is my new favorite EA. I'm having a great deal of fun fiddling with the trade logic with different ideas. Thank you very much Enforcer, this is an extremely well put EA.

The one thing i'm having a bit of trouble with is that this EA takes a great deal of time to backtest. Anyway we can optimize the code so that it backtests faster?

Thank you again, wonderful job.

-dgv

You're welcome.

Backtest speed is not entirely dependent on EA tested, also count PC speed, available memory, amount of data to be tested..

Usually EAs using external indicators will run slower and also some indicators require more RAM and CPU cycles than others.

 
Enforcer:
Guys, in no mystery, is written inside EA
RSI_1 = iCustom(NULL, RSI_period,"Adaptive RSI", RSI_bars, PRICE_CLOSE, 0)*10;

RSI_2 = iCustom(NULL, RSI_period,"Adaptive RSI", RSI_bars, PRICE_CLOSE, 1)*10;

if (

RSI_1 > RSI_2 &&

RSI_1 - RSI_2 > ARSI_trigger) {tradeDirection=1;}

if (

RSI_1 < RSI_2 &&

RSI_2 - RSI_1 > ARSI_trigger) {tradeDirection=-1;}

Enforcer, just replace ARSI_trigger= 0.007 with this

ARSI_trigger = iATR(NULL,1,13, 0)*10;

You`ll stay satisfied - i`ve got 40% more profit. The DD is increased a litle. ATR bars=13 is the best, I start making tests one week ago. This is the way to grab only unusual strong impulses compared with current volatility.

Also I`ve tried with separate trailing for Buy`s and Sells. I`ve got nice increased profit about another 5%, but DD looks unacceptable.

The other thing I`ve tryed is using i_Trend, but I have changed the i_TrendDecision (if = 1 becomes = -1 and oposite if = -1 becomes = 1). The idea is simple: i_Trend is looking for main trend in H4 or H1. Same time ARSI in M1 is looking for strong impulses against the i_Trend, but the orders will be placed in the direction of the main H4 (H1) trend because ReverseDirection = true. In this way PipMaker becomes main_trend follow robot and the orders are placed in the best posible place - in the bottom of the chanel if upgoing_trend exist and in the top of the chanel if down _going trend exist. The number of the trades is much less but we`ve got DD=4,21% so we can play with more risk. I post some result from my modified versions using i_Trend.

The DD is 38.94% but note that I play with MaximumRisk=1 and profit is $4084

until end of april. Without i_Trend I`ve got profit about 15`000 but DD are still unacceptable.

I`m still testing...

 

@montedoro

please can you post the new mq4?

Reason: