PS2-1
Download scriptThe PIPSTALKER EA is an automated trading system designed to monitor market price action and execute trades based on specific structural patterns, momentum indicators, and volatility shifts. Its primary objective is to identify high-probability entry points by combining technical analysis with active risk management.
Core Trading Logic and Entry Strategies
The script employs several distinct logic "modules" to determine when to enter a trade. It scans the market for four specific types of price behaviors:
1. Momentum & RSI Filtering (Trigger Bars) The system looks for significant price movement in a single candle (a large "trigger" move). To ensure these moves aren't occurring in overextended markets, it cross-references the move with the Relative Strength Index (RSI). It only enters if the market is not currently in an extreme state (staying between the 30 and 70 RSI levels), ensuring there is still "room" for the price to continue moving in that direction.
2. Reversal Patterns (Pinocchio Bars) The EA identifies specific "tail" formations in the price history. If it detects a candle where the low price significantly exceeds the lows of the previous two candles, it interprets this as a potential reversal and initiates a buy position. Conversely, if it sees a sudden spike in high prices compared to recent history, it identifies a selling opportunity.
3. Consolidation Breakouts The system monitors for periods of "tight" trading where price movement is very restricted (consolidation). When the market finally breaks out of this narrow range with enough force—specifically when the price moves a set distance away from the previous consolidation candles—the EA executes a trade to capture the resulting momentum.
4. Low-Volatility Breakouts The script also monitors for periods of prolonged stability. It checks a sequence of the last 10 candles to see if they have remained relatively flat. If this "quiet" period is followed by a moderate price move that stays within a specific range, the EA uses a long-term RSI setting to determine the overall trend and enters a position aligned with that direction.
Risk Management Features
Beyond simply identifying entries, the script includes several automated tools to protect capital:
- Dynamic Stop Loss and Take Profit: Every trade is governed by predefined price targets and safety limits (Stop Loss) calculated based on the minimum price fluctuations (Points).
- Automated Trailing Stop: To lock in profits as a trade moves in the desired direction, the script features a "Trailing Stop" mechanism. As the price improves, the safety net (Stop Loss) automatically follows the price at a fixed distance. This allows the system to protect gains while giving the trade enough room to continue running toward its maximum profit target.
- Balance Awareness: The system tracks the account's high-water mark (the highest equity reached), allowing it to monitor the health of the account relative to its peak performance.
//PIPSTALKER EA by tdion
int ticket1, ticket2, ticket3, ticket4, ticket5, ticket6, ticket7, ticket8, ticket9, ticket10;
double o, h, l, c;
extern int TP = 145;
extern int TP2 = 300;
extern int SL2 = 40;
extern int SL = 37;
extern int trigger = 55;
extern int trigger2 = 20;
extern bool TrailingStopMode = True;
extern int TrailingStop = 20;
double size;
double balance;
double balancehigh=0;
bool done;
bool open;
int start()
{
done = false;
balance = AccountEquity();
if(balance>balancehigh)
balancehigh = balance;
//size=(MathRound(AccountEquity()/2000))/10;
size=0.1;
if((balance/balancehigh)>0.89)
{
//size =(MathRound(AccountEquity()/1000))/10;
}
if(Open[0]!=o)
if(High[0]!=h)
if(Low[0]!=l)
if(Close[0]!=c)
{
o = Open[0];
h = High[0];
l = Low[0];
c = Close[0];
//trigger bars
if((Close[1] - Open[1] > trigger*Point)||(Open[1] - Close[1] > trigger*Point))
if((iRSI(NULL,0,14,PRICE_CLOSE,1)<70)&&(iRSI(NULL,0,14,PRICE_CLOSE,1)>30))
{
ticket1=OrderSend(Symbol(),OP_BUY,size,Ask,3,Ask-SL*Point,Ask+TP*Point,NULL,0,0,Green);
ticket2=OrderSend(Symbol(),OP_SELL,size,Bid,3,Bid+SL*Point,Bid-TP*Point,NULL,0,0,Red);
done = true;
}
//pinnochio bars
if((Low[2] < Low[1] - 25*Point)&&(Low[2] < Low[3] - 25*Point))
if(!done)
{
done=true;
ticket5=OrderSend(Symbol(),OP_BUY,size,Ask,3,Ask-30*Point,Ask+100*Point,NULL,0,0,Green);
}
//double bar resistance
if((High[2] > High[1] + 25*Point)&&(High[2] > High[3] + 25*Point))
if(!done)
{
done = true;
ticket6=OrderSend(Symbol(),OP_SELL,size,Bid,3,Bid+30*Point,Bid-100*Point,NULL,0,0,Green);
}
//consolidation breakout
if(!done)
{
if(MathAbs(Low[2] - Low[1]) < Point*2)
if(Low[1] < Close[1] - Point*45)
{
done = true;
ticket7=OrderSend(Symbol(),OP_BUY,size,Ask,3,Ask-45*Point,Ask+150*Point,NULL,0,0,Green);
}
if(MathAbs(High[2] - High[1]) < Point*2)
if(High[1] > Close[1] + Point*45)
{
ticket8=OrderSend(Symbol(),OP_SELL,size,Bid,3,Bid+45*Point,Bid-150*Point,NULL,0,0,Green);
done = true;
}
}
//Trailing stop
if(TrailingStopMode && TrailingStop > 0) {
if(Bid - OrderOpenPrice() > Point * TrailingStop) {
if(OrderStopLoss() < Bid - Point * TrailingStop) {
OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
return(0);
}
}
}
//Trailing stop
if (TrailingStopMode && TrailingStop > 0)
{
if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {
if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
return(0);
}
}
}
if(!done)
{
open=true;
for(int i=10;i>1;i--)
if(MathAbs(Open[i] - Close[i]) > Point*10)
open=false;
if(open)
if(Close[1] - Open[1] > Point*20)
if(Close[1] - Open[1] < Point*55)
if((iRSI(NULL,0,96,PRICE_CLOSE,1)>50))
{
ticket9=OrderSend(Symbol(),OP_BUY,size,Ask,3,Ask-40*Point,Ask+200*Point,NULL,0,0,Green);
}
open=true;
for(i=10;i>1;i--)
if(MathAbs(Open[i] - Close[i]) > Point*10)
open=false;
if(open)
if(Open[1] - Close[1] > Point*20)
if(Open[1] - Close[1] < Point*55)
if((iRSI(NULL,0,96,PRICE_CLOSE,1)<50))
{
ticket10=OrderSend(Symbol(),OP_SELL,size,Bid,3,Bid+40*Point,Bid-200*Point,NULL,0,0,Red);
}
}
}
return(0);
}
Profitability Reports
Expected payoff
Average expected payoff across the available backtests for each symbol.
Comments