Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools
Zurück   Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools > Metatrader 4 > Programmierung MQL4

Programmierung MQL4 Hier gehts rund ums Programmieren in MQL4.

Login
Benutzername:
Kennwort:


Statistik
Themen: 4973
Beiträge: 43248
Benutzer: 7.219
Aktive Benutzer: 81
Links: 84
Wir begrüßen unseren neuesten Benutzer: Hopfen&Malz
Mit 2.475 Benutzern waren die meisten Benutzer gleichzeitig online (16.01.20 um 22:38).
Neue Benutzer:
vor einem Tag
- Hopfen&Mal...
vor 2 Tagen
- frankmicha...
vor einer Woche
- DFeck
vor einer Woche
- bb1107
vor 2 Wochen
- rg-trader

Onlineuser
'Wer ist online' anzeigen Benutzer: 0
Gäste: 243
Gesamt: 243
Team: 0
Team:  
Benutzer:  
Freunde anzeigen

Empfehlungen

Thema geschlossen
 
Themen-Optionen Thema durchsuchen Ansicht
  #1 (permalink)  
Alt 21.11.14
Neues Mitglied
 
Registriert seit: Apr 2014
Beiträge: 1
lorbas befindet sich auf einem aufstrebenden Ast
Standard Break_Out_Indikator

suche jemanden der mir bei meinen Indikator hilft brauche noch eine Funktion
//+------------------------------------------------------------------+

//| Break_Out.mq4 |


//+------------------------------------------------------------------+

#property copyright "Den"
#property indicator_chart_window


extern int Kerzen = 15;
extern int pause = 0;
extern double PfeilHochFactor = 0.999;
extern double PfeilRunterFactor = 1.001;
double hightick,lowtick;
bool start = true;
bool breaked = false;
int counter,tmppause,oldTime;
int bigcount=1;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

tmppause = pause;
breaked = false;
counter = 0;
SetLevels();
start=true;
oldTime = Time[0];

return(0);
}
int deinit()
{
//----
int i, ot=ObjectsTotal()-1;
string id;
//----
for(i=ot;i>=0;i--)
{id=ObjectName(i);
if (id=="highlevel"||id=="lowlevel")
ObjectDelete(id);
if(StringSubstr(id,0,2)=="Up"||StringSubstr(id,0,2 )=="Dn")
{ObjectDelete(id);
}
}

return(0);
}

//+------------------------------------------------------------------+

//| Money Flow Index |

//+------------------------------------------------------------------+

int start()

{
if (breaked){
if(oldTime != Time[0])
{
if(tmppause<=0){
breaked = false;
tmppause=pause;
start = true;
}
else {
oldTime = Time[0];
tmppause--;
}
}

return(0);
}
//tmppause = pause;
int i,nCountedBars;
//---- insufficient data
if (start) SetLevels();
ChartRedraw(0);
RefreshRates();
if (Close[0]>hightick){
string name = "Up"+counter;

ObjectCreate(name, OBJ_ARROW, 0, Time[0], Close[0]*PfeilHochFactor); //draw an up arrow
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name, OBJPROP_ARROWCODE, 233);
ObjectSet(name, OBJPROP_COLOR,Green);
counter++;
breaked = true;
oldTime = Time[0];

}
if (Close[0]<lowtick){
string name2 = "Dn"+counter;
ObjectCreate(name2,OBJ_ARROW, 0, Time[0], Close[0]*PfeilRunterFactor); //draw a dn arrow
ObjectSet(name2, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name2, OBJPROP_ARROWCODE, 234);
ObjectSet(name2, OBJPROP_COLOR,Red);
counter++;
breaked = true;
oldTime = Time[0];

}
Comment(StringFormat("Show prices\nMomentan = %G\nHigLevel = %G\nlowLevel = %G\ncounter = %G\n",Close[0],hightick,lowtick,bigcount));
bigcount++;
// if(Bars<=Kerzen) return(0);

//---- bars count that does not changed after last indicator launch.

//nCountedBars=IndicatorCounted();



return(0);

}
void SetLevels(){
hightick =0;
lowtick = 1000000;
for (int i=0;i<Kerzen;i++){
if (High[i]>hightick)
hightick = High[i];
if (Low[i]<lowtick)
lowtick = Low[i];

}
//ObjectCreate("highlevel",OBJ_HLINE,0,Time[0],hightick);
ObjectDelete("lowlevel");
ObjectDelete("highlevel");
HLineCreate(0,"lowlevel",0,lowtick,clrBlue,0,1,fal se,true,true,0);
HLineCreate(0,"highlevel",0,hightick,clrBlue,0,1,f alse,true,true,0);
ChartRedraw(0);
//ObjectCreate("lowlevel",OBJ_HLINE,0,Time[0],lowtick);
start = false;
}
bool HLineCreate(const long chart_ID=0, // chart's ID
const string name="HLine", // line name
const int sub_window=0, // subwindow index
double price=0, // line price
const color clr=clrBlue, // line color
const ENUM_LINE_STYLE style=STYLE_SOLID, // line style
const int width=1, // line width
const bool back=false, // in the background
const bool selection=true, // highlight to move
const bool hidden=true, // hidden in the object list
const long z_order=0) // priority for mouse click
{
//--- if the price is not set, set it at the current Bid price level
if(!price)
price=SymbolInfoDouble(Symbol(),SYMBOL_BID);
//--- reset the error value
ResetLastError();
//--- create a horizontal line
if(!ObjectCreate(chart_ID,name,OBJ_HLINE,sub_windo w,0,price))
{
Print(__FUNCTION__,
": failed to create a horizontal line! Error code = ",GetLastError());
return(false);
}
//--- set line color
ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- set line display style
ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style );
//--- set line width
ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width );
//--- display in the foreground (false) or background (true)
ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- enable (true) or disable (false) the mode of moving the line by mouse
//--- when creating a graphical object using ObjectCreate function, the object cannot be
//--- highlighted and moved by default. Inside this method, selection parameter
//--- is true by default making it possible to highlight and move the object
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE, selection);
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,se lection);
//--- hide (true) or display (false) graphical object name in the object list
ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidd en);
//--- set the priority for receiving the event of a mouse click in the chart
ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_or der);
//--- successful execution
return(true);
}
//+------------------------------------------------------------------+



möchte noch eine ränge einbauen weil so er alle Kerzen beobachtet und ich will das er Kerzen beobachtet die in einer bestimmten rang liegen die man selber einstellen kann
Thema geschlossen

Lesezeichen

Stichworte
kerze, kerzen, mql4, programmierung, programmierung metatrader, rang, ränge

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus




Alle Zeitangaben in WEZ +1. Es ist jetzt 16:57 Uhr.





Suchmaschine - Reisen - Wavesnode - Facebook Forum - Spam Firewall
-----------------------------------------------------------------------------------------------------------------------------
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
SEO by vBSEO 3.6.1
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum
MetaTrader bzw. MetaTrader 4 und MetaTrader 5 sind eingetragene Marken der MetaQuotes Software Corp.
-----------------------------------------------------------------------------------------------------------------------------