//+------------------------------------------------------------------+ //| bullbreath.mq4 | //| Thonas Bopp | //| http://www.fx-training.de | //+------------------------------------------------------------------+ /*Dieser Indikator zählt, wieviele der letzten 10 Balken im Plus gelandet sind. Im Tageschart zeigt ein Stand von 3 eine Kaufsituation an. Ein Stand von sieben und grösser eine Verkaufsituation.*/ #property copyright "Bopp Kapitalmarktstudien" #property link "http://www.fx-training.de" #property indicator_separate_window #property indicator_level1 3 #property indicator_level2 7 #property indicator_buffers 1 #property indicator_color1 Red //---- buffers double ExtMapBuffer1[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); string short_name = "Bullbreath (c)www.fx-training.de"; IndicatorShortName(short_name); //---- return(1); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { 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 pos=Bars-counted_bars; double aclose , avclose , dResult; //-- aclose=aktueller Kurs avclose=Kurs vor aktuellem Kurs Comment("Bullbreath (c)www.fx-training.de"); //---- main calculation loop //---- Einstellung, die letzten 10 Balken. Prüfung: //---- Kurs gegen Vorbalken höher=Indikator +1 //---- Kurs gegen Vorbalken niedriger= Indikator unverändert while(pos>=0) { dResult = 0; int j; for (j=0; j<11;j++) { aclose = Close[pos+j]; avclose = Close[pos+j+1]; if(aclose > avclose) { dResult=dResult+1; } } ExtMapBuffer1[pos]= dResult ; pos--; } //---- return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains close prices for each bar
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: