Witam. Czy ktoś zna wskaźnik, który na wykresie zaznaczyłby "okrągłe obszary" ( np.EUR/USD - 1.30000, 1.29000) coś jak grid z tym,że nie chodzi o same linie, ale strefę 15 pipsów nad i pod okrągłą wartością.( np.od 1.3015 do 1.2985). Szukałem w necie , nic nie znalazłem. Może ktoś byłby chętny napisać , taki wskaźnik.
PZDR
PPA potrzebny wskaźnik.
Re: PPA potrzebny wskaźnik.
To się nazywa szybka reakcja xD
-- Dodano: 07 mar 2013, 09:13 --
Dzięki !!!
-- Dodano: 07 mar 2013, 09:13 --
Dzięki !!!
Re: PPA potrzebny wskaźnik.
Uważam, że lepsze jest coś takiego:
Kod: Zaznacz cały
//+------------------------------------------------------------------+
//| SweetSpots.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright Shimodax"
#property link "http://www.strategybuilderfx.com"
#property indicator_chart_window
/* Introduction:
This indicator shows lines at sweet spots (50 and 100
pips levels). It is recommended to turn off the grid.
Enjoy!
Markus
*/
extern int NumLinesAboveBelow= 100;
extern int SweetSpotMainLevels= 100;
extern color LineColorMain= Gray;
extern int LineStyleMain= STYLE_DOT;
extern bool ShowSubLevels= true;
extern int sublevels= 500;
extern color LineColorSub= Gray;
extern int LineStyleSub= STYLE_DOT;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
int deinit()
{
int obj_total= ObjectsTotal();
for (int i= obj_total; i>=0; i--) {
string name= ObjectName(i);
if (StringSubstr(name,0,11)=="[SweetSpot]")
ObjectDelete(name);
}
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//int period = Period();
//if (period <= 60) sublevels = sublevels;
//if (period > 60 && period <= 10080) sublevels = sublevels * 10;
//if (period > 10080) sublevels = sublevels * 100;
static datetime timelastupdate= 0;
static datetime lasttimeframe= 0;
// no need to update these buggers too often
if (CurTime()-timelastupdate < 600 && Period()==lasttimeframe)
return (0);
deinit(); // delete all previous lines
int i, ssp1, style, ssp, thickness; //sublevels= 50;
double ds1;
color linecolor;
if (!ShowSubLevels)
sublevels*= 2;
ssp1= Bid / Point;
ssp1= ssp1 - ssp1%sublevels;
for (i= -NumLinesAboveBelow; i<NumLinesAboveBelow; i++) {
ssp= ssp1+(i*sublevels);
if (ssp%SweetSpotMainLevels==0) {
style= LineStyleMain;
linecolor= LineColorMain;
}
else {
style= LineStyleSub;
linecolor= LineColorSub;
}
thickness= 1;
if (ssp%(SweetSpotMainLevels*10)==0)
{
thickness= 1;
}
if (ssp%(SweetSpotMainLevels*100)==0)
{
thickness= 1;
}
ds1= ssp*Point;
SetLevel(DoubleToStr(ds1,Digits), ds1, linecolor, style, thickness, Time[10]);
}
return(0);
}
//+------------------------------------------------------------------+
//| Helper |
//+------------------------------------------------------------------+
void SetLevel(string text, double level, color col1, int linestyle, int thickness, datetime startofday)
{
int digits= Digits;
string linename= "[SweetSpot] " + text + " Line",
pricelabel;
// create or move the horizontal line
if (ObjectFind(linename) != 0) {
ObjectCreate(linename, OBJ_HLINE, 0, 0, level);
ObjectSet(linename, OBJPROP_STYLE, linestyle);
ObjectSet(linename, OBJPROP_COLOR, col1);
ObjectSet(linename, OBJPROP_WIDTH, thickness);
ObjectSet(linename, OBJPROP_BACK, True);
}
else {
ObjectMove(linename, 0, Time[0], level);
}
}