swapping

Scalping Counter Trend strategy

Category: Indicators By: swapping Created: March 7, 2019, 2:28 PM
March 7, 2019, 2:28 PM
Indicators
21 Comments
Scalping Counter Trend strategy

– On the basis of a program written by Leo entitled “LEO MOVING AVERAGE” I propose a simple strategy to initiate positions in “Against Trend” on detection of new higher or lower …

– The program displays the maximum and minimum levels, indicates the position and the direction of the input with a planned Stop Loss indicating the extreme points. It colors the background trend on the unit of time used in blue if the asset is bullish or yellow if it is bearish. A simple 200-period moving average was added to validate the medium-term trend …

Variables make it possible to adapt this strategy to your liking:

  • “Period” Value of LMA moving average
  • “Offset” Adjust distance text Stop Loss of the candle
  • “Color” Adjusting temperature background color
  • “BackColor” Mask the background color (visual option)
  • “Text” Hidden text “Stop Loss”

 

// Scalping Counter Trend | Graph Indicator
// 06.03.2019 (Release 1.0)
// Swapping @ www.forexswap.fr
// Sharing ProRealTime knowledge (alt+16)
// Program adapted from "LEO MOVING AVERAGE" indicator created by LEO contributer of website ProrealCode.com

// --- Property Settings ---
Period    = 20 // (Value Leo Moving Average)
Offset    = 12 // (offset text candle)
Color     = 33 // (transparency background)
BackColor = 1  // 0=true; 1=false (option background color)
Text      = 1  // 0=false; 1=true (option text hidden)
// --- end

color = max(color,0)   // Limited input "Max-Min" data
color = min(color,255)

// supports and resistances
once support = low
once resistance = high

LMA = 2*weightedaverage[period](close)-average[period](close)
smoothLMA = weightedaverage[period](LMA)
sma = average[200](customclose)

// ---> Storage of minimums and maximums
if barindex > 1 then
 if low < lowest[period](low[1]) then
  mintemp = low            // minimum temporal
  posmintemp = barindex    // position of minimum temporal
  direction = 1            // Background Color Chart and Segment
  if direction = 1 then
  endif
 endif
 if high > highest[period](high[1]) then
  maxtemp = high           // maximum temporal
  posmaxtemp = barindex    // position maximum temporal
  direction = -1           // Background Color Chart and Segment
  if direction = -1 then
  endif
 endif
endif

// ---> Background Color Chart with (enable or disable) condition
if BackColor = 1 and direction < 0 then
 BackGroundColor(0,255,255,color) // Bullish blue
else
 BackGroundColor(255,255,0,color) // Bearish yellow
endif

if BackColor = 0 then               // BackgroundColor disabled
 BackGroundColor(0,0,0,0)
endif

if LMA crosses over smoothLMA then  // --> Detecting and locating a local minimum
 LEVMIN = mintemp
 POSLEVMIN = posmintemp
 support = LEVMIN
 //DrawArrowUp(POSLEVMIN+0,LEVMIN-2) coloured(20,200,0,170)  // Option Arrow Up
 DrawText("•",poslevmin,levmin-offset*0.2,Serif,Bold,16) coloured(33,200,33) // Glyphe alt+7
 if Text = 1 then
  DrawText("SL #levmin#",poslevmin,levmin-offset,SansSerif,Bold,11) coloured(33,200,33)
 endif
elsif LMA crosses under smoothLMA then // --> Detecting and locating a local maximum
 LEVMAX = maxtemp
 POSLEVMAX = posmaxtemp
 resistance = LEVMAX
 //DrawArrowDown(POSLEVMAX+0,LEVMAX+2) coloured(200,20,0,170)  // Option Arrow Down
 DrawText("•",poslevmax,levmax-offset*0.2,Serif,Bold,16) coloured(200,33,33) // Glyphe alt+7
 if Text = 1 then
  DrawText("SL #levmax#",poslevmax,levmax+offset,SansSerif,Bold,11) coloured(200,33,33)
 endif
endif

support = min(low,support)
resistance = max(high,resistance)

return LMA as " LMA", resistance coloured by resistance as " Resistance", support coloured by support as " Support", smoothLMA coloured by smoothLMA as " smoothLMA", sma coloured by sma as " SMA"

Download
Filename: Scalping-CounterTrend-strategy.itf
Downloads: 715
swapping
swapping Master
<a href="http://www.forexswap.fr/">Le trading</a> une discipline sans faille qui en décourage plus d'un ! "Et pourtant..."
Author’s Profile

Comments

leederbyshire
3 years ago
#

Hi is it possible to replace the dots with red/green vertical lines? Thank you.

Marius Zammit
5 years ago
#

Still learning and very new to all this. Can this indicator be turned into an automated trade bot thru the PR platform?

Nicolas
5 years ago
#

Yes sure, please create a dedicated post in the automated trading forum.

darbes
6 years ago
#

Nicolas How to convert this signal into a strategy pro ? Best JC

Lafras
7 years ago
#

very late to identify signal

RobertFX
8 years ago
#

Works fine on FOREX

marinober
8 years ago
#

giusto, la critica è troppo severa. Mi dispiace che l'indicatore abbia delle lacune perchè sarebbe veramente utile e l'idea ottima. Io non so programmare , mi limito a testare . Se posso rendermi utile in questo sono a disposizione.

Alby118
6 years ago
#

Great work, much appreciated! You think this will work better with HULL indicator? So the SL prints instantly.

swapping
8 years ago
#

легко критиковать показатели, закодированные в мое свободное время и оставленные бесплатно, но ничего не принося сообществу

marinober
8 years ago
#

Troppo bello per essere vero. il segnale lo da in ritardo ..... direi INUTILE e magari sarebbe bene non pubblicare indicatori che fanno repaint sono cose di 100 anni fa

marinober
8 years ago
#

ciao... fa repaint ?

swapping
8 years ago
#

Thank you very much Leo, I will make other mix that can be interesting with different code of this community ... Best regards ;)

darbes
6 years ago
#

Nicolas Could you code in PRT from an MT4 code ? Best JC

nader003
7 years ago
#

Hi .. how can we get this indicator for MT4 platform

Nicolas
7 years ago
#

You can ask for private custom coding to our programming services: https://www.prorealcode.com/trading-programming-services/

Leo
Leo
8 years ago
#

Nice... the fact that there are a Maximum or Minimum with a Long term Bias can be a powerfull resource.... I am glad that this indicator is usefull.

swapping
8 years ago
#

Hello Schmarotzer, for the forex it is necessary to put offset to "0" ! I forgot to specify it ...

EZB-Schmarotzer
8 years ago
#

Good system, but no dots on FX-Pairs like GBP/USD. Could you explain why and fix it maybe?

Sofitech
8 years ago
#

Could you give some explanation about this indicator. How long does it take to have a new high/low signal when it happens ? How many bars / candles ?

ludo6977
8 years ago
#

he is extremely late. Too bad

ludo6977
8 years ago
#

it's great work, but is it repainted? In any case good job.

ProRealCode ProRealCode
Loading...