Turbo_PT_Scalper

Download script
Author: Copyright � 2008, Tim Hyder

Overview of the PowerTrend 5 Minute Scalper

The PowerTrend 5 Minute Scalper is a specialized trading tool designed to identify high-probability entry points by analyzing market momentum and multi-timeframe trends simultaneously. Rather than relying on a single price movement, this script looks for "confluence"—the moment when several different technical conditions align to suggest a significant move in the market's direction.

How the Logic Works

The indicator functions through three primary layers of analysis:

1. Multi-Timeframe Trend Alignment

One of the most sophisticated features of this script is its ability to "look" at multiple timeframes at once. It calculates moving averages across different time scales (ranging from low to maximum) to ensure that the current trade aligns with the broader market direction.

  • Trend Identification: The script checks if the trends are in a perfect sequence. For example, if the short-term trend is moving up and every larger timeframe above it is also moving up, the script identifies a strong bullish bias.
  • Dynamic Sensitivity: Depending on how strong these trends are, the script automatically adjusts its sensitivity levels (the "zones" where it looks for trades) to be either more relaxed or more strict.

2. Momentum and Overbought/Oversold Analysis

To prevent entering a trade too late, the script uses a momentum oscillator (RSI). It tracks whether the market is becoming overextended in one direction.

  • It monitors whether the price is "stretched" too far up or down.
  • Crucially, it looks for reversal signals: it identifies moments when the momentum starts to slow down or turn back, providing a safer entry point than simply chasing a moving price.

3. Price Action Confirmation

The final "green light" for a signal is based on the relationship between the current market price and specific moving average boundaries. The script looks for specific crossovers where:

  • For a Long (Buy) Signal: The price must be below a specific lower boundary while the momentum indicator shows a significant upward turn from an oversold position.
  • For a Short (Sell) Signal: The price must be above a specific upper boundary while the momentum indicator shows a significant downward turn from an overbought position.

Visual and Audio Alerts

When all three conditions—Multi-Timeframe Trend, Momentum Reversal, and Price Action—align perfectly, the script provides immediate feedback:

  • Visual Cues: It places clear arrows on your chart (pointing up for Longs and down for Shorts). The distance of these arrows from the candles is automatically adjusted based on the timeframe you are viewing to ensure they remain readable.
  • Notifications: The script can trigger real-time alerts, including pop-up messages on your screen, audible sounds, or email notifications (if configured), ensuring you never miss a potential entry even when you aren't staring directly at the chart.

Summary for the User

In simple terms, this script acts as a sophisticated filter. It ignores "noise" by only highlighting trades that occur when the short-term price action, the medium-term momentum, and the long-term market trend are all pointing in the same direction at the exact same moment.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It plays sound alertsIt sends emails
11 Views
0 Downloads
0 Favorites
Turbo_PT_Scalper
//+------------------------------------------------------------------+ 
//|               PowerTrend 5 Minute Scalper                        | 
//|                                                                  | 
//|   Copyright © 2008, Tim Hyder aka Hiachiever                     |
//|                                                                  |
//+------------------------------------------------------------------+ 
#property copyright "Copyright © 2008, Tim Hyder"
#property link      "http://www.the4xtrader.com"

#define vers    "20.Feb.2008"
#define major   1
#define minor   0

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DodgerBlue
#property indicator_color2 Magenta
#property indicator_color3 DodgerBlue
#property indicator_color4 Magenta
#property indicator_width1 2
#property indicator_width2 2


extern string NOTESETTINGS = " - - - INDICATOR SETTINGS - - - ";
extern int MA1.Period = 5;
extern int MA2.Period = 5;

extern string NOTE1 = " 0 = SMA, 1 = EMA, 2 = SSMA, 3 = LWMA";
extern int MA1.Method = MODE_EMA;
extern int MA2.Method = MODE_EMA;

extern string NOTE2 = "0 = Close, 1 = Open, 2 = High, 3 = Low";
extern int MA1.Price = PRICE_HIGH;
extern int MA2.Price = PRICE_LOW;

extern int MA1.Shift=0;
extern int MA2.Shift=0;

extern int RSI.Period = 9;
extern int RSI.Upper = 70;
extern int RSI.Lower = 30;
extern string NOTEALERTS = " - - - -  ALERTS  - - - - ";
extern bool MsgAlerts = true;
extern bool SoundAlerts = true;
extern string SoundAlertFile = "alert.wav";
extern bool eMailAlerts = false;

double Buf1[], Buf2[], ShortSig[], LongSig[];
double LO_TF_EMA_1 = 0, LO_TF_EMA_2 = 0, MID_TF_EMA_1 = 0, MID_TF_EMA_2 = 0, HI_TF_EMA_1 = 0, HI_TF_EMA_2 = 0, MAX_TF_EMA_1 = 0, MAX_TF_EMA_2 = 0;
string prefix = "PTScalper";
datetime LastAlert;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   //---- indicators
   IndicatorBuffers(4);

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Buf1);
   SetIndexDrawBegin(0,MA1.Period+MA1.Shift);
   
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Buf2);
   SetIndexDrawBegin(1,MA1.Period+MA1.Shift);

 	SetIndexBuffer(2,LongSig);
	SetIndexStyle(2,DRAW_ARROW,EMPTY,1);
	SetIndexArrow(2,233);
	
	SetIndexBuffer(3,ShortSig);
	SetIndexStyle(3,DRAW_ARROW,EMPTY,1);
	SetIndexArrow(3,234);

   //---- name for DataWindow and indicator subwindow label   
   IndicatorShortName(prefix);
   LastAlert = Time[0];

   //----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double MAHg, MALw, RSI_Current = 0, RSI_Prior = 0; 
   string Subj, Msg;
   string MainTxt = Symbol()+ ", TF: " + TF2Str(Period());
  
   int counted_bars=IndicatorCounted();
   //---- check for possible errors
   if(counted_bars<0) return(-1);
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   int limit=Bars-counted_bars;
   for(int i=0;i<limit;i++)
   {
      MAHg = iMA(NULL, 0, MA1.Period, MA1.Shift, MA1.Method, MA1.Price, i+1);
      MALw = iMA(NULL, 0, MA2.Period, MA2.Shift, MA2.Method, MA2.Price, i+1);
      
      LO_TF_EMA_1 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 3, i);
      LO_TF_EMA_2 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 3, i+1);
      MID_TF_EMA_1 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 2, i);
      MID_TF_EMA_2 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 2, i+1);
      HI_TF_EMA_1 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 1, i);
      HI_TF_EMA_2 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 1, i+1);
      MAX_TF_EMA_1 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 0, i);
      MAX_TF_EMA_2 = iCustom(Symbol(), Period(), "4MA_Price_Action_MTF", 0, 1000, 21, 0, " ", MODE_EMA, " ", PRICE_MEDIAN, 0, i+1);
      
      RSI.Upper = 70;
      RSI.Lower = 30;
      
     if (LO_TF_EMA_1 >= LO_TF_EMA_2 && LO_TF_EMA_1 >= MID_TF_EMA_1 && MID_TF_EMA_1 >= MID_TF_EMA_2 && MID_TF_EMA_1 >= HI_TF_EMA_1 && HI_TF_EMA_1 >= HI_TF_EMA_2 && HI_TF_EMA_1 >= MAX_TF_EMA_1 && MAX_TF_EMA_1 >= MAX_TF_EMA_2) {RSI.Upper = 80;RSI.Lower = 40;} 
     if (LO_TF_EMA_1 <= LO_TF_EMA_2 && LO_TF_EMA_1 <= MID_TF_EMA_1 && MID_TF_EMA_1 <= MID_TF_EMA_2 && MID_TF_EMA_1 <= HI_TF_EMA_1 && HI_TF_EMA_1 <= HI_TF_EMA_2 && HI_TF_EMA_1 <= MAX_TF_EMA_1 && MAX_TF_EMA_1 <= MAX_TF_EMA_2) {RSI.Upper = 60;RSI.Lower = 20;} 
          
      Buf1[i] = MAHg;
      Buf2[i] = MALw;

      RSI_Prior = iCustom(Symbol(), Period(), "Turbo_JRSX_Close", RSI.Period, 0, i+1);
      RSI_Current = iCustom(Symbol(), Period(), "Turbo_JRSX_Close", RSI.Period, 0, i);
      
      if (Close[i] > MAHg && RSI_Current >RSI.Upper && RSI_Current < RSI_Prior)
      {
         ShortSig[i] = High[i]+SignalArrowSpacer(); 
         if (LastAlert != Time[0])
         {
           Subj = MainTxt + ".  Short Entry Alert";
           Msg = Subj + " @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
           DoAlerts(Msg,Subj);
           LastAlert = Time[0]; 
         }
      }   
      else if (Close[i] < MALw && RSI_Current < RSI.Lower && RSI_Current > RSI_Prior)
      {
         LongSig[i] = Low[i]-SignalArrowSpacer();
         if (LastAlert != Time[0])
         {
           Subj = MainTxt + ".  Long Entry Alert";
           Msg = Subj + " @ " + TimeToStr(TimeLocal(),TIME_SECONDS);
           DoAlerts(Msg,Subj);
           LastAlert = Time[0]; 
         }
      }
      
   }
   return(0);
  }
//+------------------------------------------------------------------+

void DoAlerts(string msgText,string eMailSub)
{
  {
   if (MsgAlerts) Alert(msgText);
   if (SoundAlerts) PlaySound(SoundAlertFile);
   if (eMailAlerts) SendMail(eMailSub, msgText);
  }
}


double SignalArrowSpacer()
//Allow the correct positioning of Signal Arrows for each TF.
{
   switch(Period())
   {
      case PERIOD_M1: return(5*Point); break;
      case PERIOD_M5: return(5*Point); break;
      case PERIOD_M15: return(10*Point); break;
      case PERIOD_M30: return(15*Point); break;
      case PERIOD_H1: return(20*Point); break;
      case PERIOD_H4: return(30*Point); break;
      case PERIOD_D1: return(60*Point); break;
      case PERIOD_W1: return(100*Point); break;
      case PERIOD_MN1: return(150*Point); break;
   }
}

string TF2Str(int period) 
{
  switch (period) 
  {
    case PERIOD_M1: return("M1");
    case PERIOD_M5: return("M5");
    case PERIOD_M15: return("M15");
    case PERIOD_M30: return("M30");
    case PERIOD_H1: return("H1");
    case PERIOD_H4: return("H4");
    case PERIOD_D1: return("D1");
    case PERIOD_W1: return("W1");
    case PERIOD_MN1: return("MN");
  }
  return (Period());
} 

Comments