A lot of people use the famous WHS signal "EL Bullish Breakout Line" (in WHS Store, free) for powerfull trading systems. Here is a trading system for DOW JONES or Wall Sreet CFD, using this signal, a trend filter, a trailing stop and the standard Profit Target :
The parameters can be see here : https://www.mogalef-trading.com/dow-jon ... tem-for-20
And the complete model can be download here : https://www.mogalef-trading.com/confere ... nvest-2018  password : Aldebaran2018
You can see a trailing stop named "EL_Stop_Intelligent_V2. It's the news version (ameliorated) of an ancient traling stop named "EL_Stop_Intelligent". 
What is this stop doing?
- It take place out of volatility noise
- It screens tops or bottoms to ajust its level.
- It screens variations of volatility and try to protect gains without be to close of the price.
- It's trying to stay in the market and take profit with large moves.
Intelligent stop V2 is a part of Mogalef Tools (Eric Lefort) available in the WHS Store of the Nanotrader, but I have decide to make you present of the first version of this stop.
Here is the code, hoping you'll enjoy it !
Express stop EL_Stop_Intelligent
// Conception Eric Lefort pour Mogalef et WHSelfinvest. 2013-10-30_2013-12-11
Vars
input $Quality(1,3,2);        // Qualité des hauts ou bas exprimé en nombre de bougies à droite et à gauche
input $RecentVolat(1,3,2);    // Durée sur laquelle est mesurée la volatilité récente
input $RefVolat(10,50,20);    // Durée sur laquelle est mesurée la volatilité de référence.
input $CoefVolat(1,30,5);     // Coefficient multiplicateur de l'ATR ET de l'écart à la normale de l'ATR (Space)
Input $FirstLowOrMore(1,3,2); // S'aligne (à la hausse) sur le plus bas des X derniers bas.
Input $FirstHighOrMore(1,3,2);// S'aligne (à la baisse) sur le plus haut des X derniers hauts.
input $WaitForXtrem(0,3,0);   // Attendre (ou pas) que l'extrème de x bougies soit passé
series B0,B1,B2,B3; //,B4,B5;
series haut;
series bas;
series H0,H1,H2,H3; //,H4,H5;
series CBI;
series tr,avtr,avtrref,space,stlong,stoplong,flaglong; 
// note : stlong,stoplong et flaglong sont également utilisées pour les courts.
series HH0,BB0;
numeric i;
calculation
CalculateAtEveryTick(false);
CBI= currentbarindex();
// ***************************************DEBUT ATRS
// ***L'ATRS est la véritable valeur de l'ATR calculée avec une moyenne mobile simple***
if isfinalbar() then begin  // calcul de la série tr
for i=0 to CBI
begin
if (h-l)>absvalue(c[i+1]-l) then
  if (h-l)>absvalue(h-c[i+1]) then
    tr=(h-l);
    else
    tr=absvalue(h[i]-c[i+1]);
  else
  if absvalue(c[i+1]-l[i])>absvalue(h[i]-c[i+1]) then
    tr[i]=absvalue(c[i+1]-l[i]);
    else
    tr[i]=absvalue(h[i]-c[i+1]);
end
  MovingAverage(tr,avtr,$RecentVolat);
  MovingAverage(tr,avtrref,$RefVolat);
end // la série tr n'est calculée qu'une seule fois par barre.
//*****************************************FIN ATRS
//******************************************************* Calcul espace additionel 
// C'est l'espace ajouté aux niveaux des bas (ou hauts) qui servent de référence aux placements des stops.
// Egal à la différence : 2 fois la volat de référence (20 périodes?) moins 1 fois la volat récente
if isfinalbar() then begin
for i=0 to CBI
begin
Space[i] = (((2*avtrref[i])-(avtr[i]))*$CoefVolat)/5;
end
end // la série Space n'est calculée qu'une fois par barre
//******************************************************* Calcul espace additionel FIN
// Importance des hauts et des bas : dépends de la variable $Quality
if isfinalbar() then begin
for i=CBI downto 0
begin
haut[i]=0;
bas[i]=0;
if $Quality=1 then begin
  if  ((h[i]<h[i+1]) and (h[i+1]>h[i+2])) or ( (h[i]<h[i+1]) and (h[i+1]>=h[i+2]) and (h[i+2]>h[i+3]) ) then haut[i]=1;
  if ((l[i]>l[i+1]) and (l[i+1]<l[i+2])) or ((l[i]>l[i+1]) and (l[i+1]<=l[i+2]) and (l[i+2]<l[i+3])) then bas[i]=1;
  end
  else begin
    if ( ($Quality=2) and (h[i]<h[i+2]) and (h[i+1]<h[i+2]) and (h[i+3]<=h[i+2]) and (h[i+2]>h[i+4]) ) then haut[i]=2;
    if ( ($Quality=2) and (l[i]>l[i+2]) and (l[i+1]>l[i+2]) and (l[i+3]>=l[i+2]) and (l[i+4]>=l[i+2]) ) then bas[i]=2;
    if ( ($Quality>=3) and (h[i]<h[i+3]) and (h[i+1]<h[i+3]) and (h[i+2]<=h[i+3]) and (h[i+3]>=h[i+4]) and (h[i+3]>=h[i+5]) and (h[i+3]>=h[i+6]) ) then haut[i]=3;
    if ( ($Quality>=3) and (l[i]>l[i+3]) and (l[i+1]>l[i+3]) and (l[i+2]>=l[i+3]) and (l[i+3]<=l[i+4]) and (l[i+3]<=l[i+5]) and (l[i+3]<=l[i+6]) ) then bas[i]=3;  
  end
// Stockage des hauts
// test de haut actuel  
if ( haut[i]>0 ) then begin //si on a un nouveau haut on décale
  H3[i]=H2[i+1];      
  H2[i]=H1[i+1];
  H1[i]=h[i+$Quality];
  end
  else begin //sinon on garde les anciennes valeurs
  H3[i]=H3[i+1];
  H2[i]=H2[i+1];
  H1[i]=H1[i+1];
  end
// Stockage des bas
// test de bas actuel  
if ( bas[i]>0 ) then begin //si on a un nouveau BAS on décale
  B3[i]=B2[i+1];
  B2[i]=B1[i+1];
  B1[i]=L[i+$Quality];
  end
  else begin //sinon on garde les anciennes valeurs
  B3[i]=B3[i+1];
  B2[i]=B2[i+1];
  B1[i]=B1[i+1];
  end
end
end // les séries B et H ne sont calculées qu'une fois par barre
// ****** On met à jour la variable flaglong pour test de position ou de position antérieure à la bougie présente***
if MarketPosition() = 1 then flaglong=1; // flag pour test de position antérieure
if MarketPosition() = -1 then flaglong=-1; // flag pour test de position antérieure
if $WaitForXtrem>0 then begin //*******************************************************************
// Note : placé ici pour utiliser lorsqu'on ne remonte le stop qu'au passage d'un Xtreme-----------]
// Sinon, on peut le supprimer
BB0=B1; // 
if $WaitForXtrem=2 then BB0=min(B1,B2);
  else begin
   if $WaitForXtrem>2 then BB0=min(min(B1,B2),B3);
  end
// ------------------------------------------------------------------------------------------------]
// Note : placé ici pour utiliser lorsqu'on ne remonte le stop qu'au passage d'un Xtreme-----------]]
// Sinon, on peut le supprimer
HH0=H1;
if $WaitForXtrem=1 then H0=H1;
  else begin
    if $WaitForXtrem=2 then HH0=max(H1,H2);
    else begin
      if $WaitForXtrem>=3 then HH0=max(max(H1,H2),H3);
    end
  end
// ------------------------------------------------------------------------------------------------]]
end //*********************************************************************************************
If flaglong=1 then begin //******ZONE DE CALCUL SI POSITION LONGUE
// ******On donne à B0 la valeur du bas le plus bas dans les X derniers bas. C'est la base du stop******
B0=B1; // cas où $FirstLowOrMore=1
if $FirstLowOrMore=2 then B0=min(B1,B2);// cas où $FirstLowOrMore=2
  else begin
   if $FirstLowOrMore>2 then B0=min(min(B1,B2),B3);// cas où $FirstLowOrMore=3
  end
//******************************************************* Calcul du niveau de stop de départ 
Stlong=B0-Space;
if ((Stlong>c) or (Stlong<0.01)) then stlong=(c-absvalue(Space));
//******************************************************* Calcul du niveau de stop de départ FIN
If ((flaglong[1] = 1) and (stlong<stoplong[1])) or ((($WaitForXtrem>0) and (h<=hh0[1])))then begin  // si on était acheteur et que le stop ne doit pas bouger
  stoplong=stoplong[1];                                   // on ne bouge pas
  end
  else begin                                              // mais s'il doit être plus près
      stoplong=stlong;                                        // on ajuste
  end
if MarketPosition() = 1 then //Long position : on met le stop
   SetStopPrice(Stoplong);
end ////////******ZONE DE CALCUL SI POSITION LONGUE FIN
If flaglong=-1 then begin //******ZONE DE CALCUL SI POSITION COURTE
// ******On donne à H0 la valeur du haut le plus haut des X derniers hauts. C'est la base du stop******
H0=H1;
    if $FirstHighOrMore=2 then H0=max(H1,H2);
    else begin
      if $FirstHighOrMore>=3 then H0=max(max(H1,H2),H3);
    end
 
//******************************************************* Calcul du niveau de stop de départ 
Stlong=H0+Space;
if Stlong<c then stlong=(c+absvalue(Space));
//******************************************************* Calcul du niveau de stop de départ FIN
If ((flaglong[1] = -1) and (stlong>stoplong[1])) or ((($WaitForXtrem>0) and (l>=bb0[1]))) then begin  // si on était vendeur et que le stop ne doit pas bouger
  stoplong=stoplong[1];                                    // on ne bouge pas (pas de stop suiveur qui s'éloigne!)
  end
  else begin                                               // mais s'il doit être plus près
       stoplong=stlong;                                         // on ajuste
  end
if MarketPosition() = -1 then //Short position : on met le stop
   SetStopPrice(Stoplong);
end ////////******ZONE DE CALCUL SI POSITION COURTE FIN
			
			
						Using Mogalef tools for DOW trading system
- 
				Eric Lefort
 - Posts: 8
 - Joined: 22 May 2014 12:40
 
Using Mogalef tools for DOW trading system
Post by Eric Lefort »
You do not have the required permissions to view the files attached to this post.
			
						
										
						Return to “WHS NANOTRADER - EXPRESS PROGRAMMING”
			
				Jump to
				
			
		
			
			
	
	- SUPPORT
 - ↳ Deutsch
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS MT4
 - ↳ Andere Themen
 - ↳ English
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS Futures - Jtrader
 - ↳ WHS Metatrader
 - ↳ Other topics
 - ↳ Français
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS Futures - Jtrader
 - ↳ WHS Metatrader
 - ↳ WHS Prorealtime futures
 - ↳ Autres sujets
 - ↳ Italiano
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS Futures - Jtrader
 - ↳ WHS Metatrader
 - ↳ Altri temi
 - ↳ Nederlands
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS Futures (Jtrader)
 - ↳ Metatrader
 - ↳ WHS Prorealtime futures
 - ↳ Andere onderwerpen
 - ↳ Polski
 - ↳ CFD
 - ↳ Forex
 - ↳ Futures
 - ↳ WHS NanoTrader
 - ↳ WHS Futures - Jtrader
 - ↳ WHS metatrader
 - ↳ WHS ProRealTime Futures
 - ↳ Inne tematy
 - WHS NANOTRADER - EXPRESS PROGRAMMING
 - ↳ Express codes & tools
 - GROUP TRADING
 - ↳ Deutsch
 - ↳ English
 - ↳ Français
 - ↳ Italiano
 - ↳ Nederlands
 - ↳ Polski
 - ↳ Trading groups
 - TRADING WEBINARS, VIDEOS & ARTICLES
 - ↳ Deutsch
 - ↳ Français
 - ↳ Italiano
 - ↳ Nederlands
 - ↳ Polski
 - TRADING SIGNALS & STRATEGIES
 - ↳ Deutsch
 - ↳ English
 - ↳ Français
 - ↳ Italiano
 - ↳ Nederlands
 - ↳ Polski
 - TRADING ARTICLES, ANALYSES & IDEAS
 - ↳ Deutsch
 - ↳ Français
 - ↳ Nederlands
 - ↳ All languages