Quarter Horse
Nuovo forumer
Ciao a tutti
ho cercato quanto scrivo sotto ... ma senza esito. Quindi se qualcuno ha tempo vrrei sapere se mi può tradurre in Prorealtime questo interessante indicatore che ho su Metatrader e sul quale ho trovato un sistema interessanteche vorrei testare su back test di PRT e del quale metterò poi il risultato insieme alle istruzioni del trading system su questo thread (sempre se a voi gradito).
Si tratta del Gann - HiLo che è simile, ma non uguale allo Swing di Gann per varie cose, non ultimo il fatto ch è parametrizzabile (ha cioè un valo re che va da 1 a 10 o anche 20 a secondas della "sensibilità" che vogliamo attribuire all'indicatore).
P.S. In questa formula ci sono anche i parametri per gli allarmi sonori, ma non mi interessa averli se è troppo complicata.
Ringrazio in anticipo chi mi aiuterà !!
Ecco la formula in MQ4:
//+------------------------------------------------------------------+
//| SSL channel chart.mq4 |
//| mladen |
//| |
//| initial SSL for metatrader developed by Kalenzo |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link "[email protected]"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_width1 2
#property indicator_width2 2
//----
extern int Lb =10;
extern bool alertsOn =false;
extern bool alertsMessage=true;
extern bool alertsSound =false;
extern bool alertsEmail =false;
//----
double ssld[];
double sslu[];
double Hlv[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0,ssld); SetIndexDrawBegin(0,Lb+1);
SetIndexBuffer(1,sslu); SetIndexDrawBegin(0,Lb+1);
SetIndexBuffer(2,Hlv);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
//----
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(i=limit;i>=0;i--)
{
Hlv=Hlv[i+1];
if(Close>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv= 1;
if(Close<iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1)) Hlv=-1;
if(Hlv==-1)
{
ssld=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
sslu=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
}
else
{
ssld=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
sslu=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
}
}
//----
if (alertsOn)
if (Hlv[0]!=Hlv[1])
if (Hlv[0]==1)
doAlert("up");
else doAlert("down");
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void doAlert(string doWhat)
{
static string previousAlert="nothing";
static datetime previousTime;
string message;
//----
if (previousAlert!=doWhat || previousTime!=Time[0])
{
previousAlert =doWhat;
previousTime =Time[0];
//----
message= StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," SSL trend changed to ",doWhat);
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(StringConcatenate(Symbol(),"SSL "),message);
if (alertsSound) PlaySound("alert2.wav");
}
}
//+------------------------------------------------------------------+
ho cercato quanto scrivo sotto ... ma senza esito. Quindi se qualcuno ha tempo vrrei sapere se mi può tradurre in Prorealtime questo interessante indicatore che ho su Metatrader e sul quale ho trovato un sistema interessanteche vorrei testare su back test di PRT e del quale metterò poi il risultato insieme alle istruzioni del trading system su questo thread (sempre se a voi gradito).
Si tratta del Gann - HiLo che è simile, ma non uguale allo Swing di Gann per varie cose, non ultimo il fatto ch è parametrizzabile (ha cioè un valo re che va da 1 a 10 o anche 20 a secondas della "sensibilità" che vogliamo attribuire all'indicatore).
P.S. In questa formula ci sono anche i parametri per gli allarmi sonori, ma non mi interessa averli se è troppo complicata.
Ringrazio in anticipo chi mi aiuterà !!
Ecco la formula in MQ4:
//+------------------------------------------------------------------+
//| SSL channel chart.mq4 |
//| mladen |
//| |
//| initial SSL for metatrader developed by Kalenzo |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link "[email protected]"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_width1 2
#property indicator_width2 2
//----
extern int Lb =10;
extern bool alertsOn =false;
extern bool alertsMessage=true;
extern bool alertsSound =false;
extern bool alertsEmail =false;
//----
double ssld[];
double sslu[];
double Hlv[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0,ssld); SetIndexDrawBegin(0,Lb+1);
SetIndexBuffer(1,sslu); SetIndexDrawBegin(0,Lb+1);
SetIndexBuffer(2,Hlv);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit;
//----
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(i=limit;i>=0;i--)
{
Hlv=Hlv[i+1];
if(Close>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv= 1;
if(Close<iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1)) Hlv=-1;
if(Hlv==-1)
{
ssld=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
sslu=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
}
else
{
ssld=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
sslu=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
}
}
//----
if (alertsOn)
if (Hlv[0]!=Hlv[1])
if (Hlv[0]==1)
doAlert("up");
else doAlert("down");
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void doAlert(string doWhat)
{
static string previousAlert="nothing";
static datetime previousTime;
string message;
//----
if (previousAlert!=doWhat || previousTime!=Time[0])
{
previousAlert =doWhat;
previousTime =Time[0];
//----
message= StringConcatenate(Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," SSL trend changed to ",doWhat);
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(StringConcatenate(Symbol(),"SSL "),message);
if (alertsSound) PlaySound("alert2.wav");
}
}
//+------------------------------------------------------------------+