Price Data Components
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
Stabilitit Indikatot BUY_SELL
#property copyright "Raouf Riad"
#property link "r-riad@web.de"
#property indicator_separate_window
//---- input parameters
double par_step=0.07;
double par_max=0.2;
extern color buycolour=Lime;
extern color sellcolour=Red;
int Buy = 221;
int Sell = 222;
int Wait = 76;
int myspace;
string shortname = "Marktstabilität Indikator BUY_SELL (c) Raouf Riad 2009-2010";
string timeframes []={"M5","M15","M30","H1"};
int times[]={5,15,30,60};
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if (Year()>2015)
{
Alert("");
return(0);
}
IndicatorShortName(shortname);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
if (Year()>2015)
{
Alert("");
return(0);
}
int counted_bars=IndicatorCounted();
myspace=WindowFind(shortname);
//----------------------------------------------------------------------------------------------------------------------
//---- to do the drawings once only
//----------------------------------------------------------------------------------------------------------------------
static bool alreadydrawn= false;
if (alreadydrawn==false)
{
//------------------------------------------------------------------------------
// create position and pipDiff and swing
//------------------------------------------------------------------------------
ObjectCreate("Stabilität",OBJ_LABEL,myspace,0,0,0,0,0,0);
ObjectSet("Stabilität",OBJPROP_XDISTANCE,10);
ObjectSet("Stabilität",OBJPROP_YDISTANCE,25);
ObjectSetText("Stabilität","Stabilität",12,"Times New Roman",Black);
for (int x=0;x<4;x++)
{
ObjectCreate("timename"+x,OBJ_LABEL,myspace,0,0,0,0,0,0);
ObjectSet("timename"+x,OBJPROP_XDISTANCE,(x*80)+100);
ObjectSet("timename"+x,OBJPROP_YDISTANCE,14);
ObjectSetText("timename"+x,timeframes[x],7,"Times New Roman",Blue);
}
//-------------------------------------------------------------------------------------------------------
// activate the position symbols
//-------------------------------------------------------------------------------------------------------
for ( x=0;x<4;x++)
{
ObjectCreate("trend"+x,OBJ_LABEL,myspace,0,0,0,0,0,0);
ObjectSet("trend"+x,OBJPROP_XDISTANCE,(x*80)+100);
ObjectSet("trend"+x,OBJPROP_YDISTANCE,30);
ObjectSetText("trend"+x,CharToStr(Wait),10,"Wingdings",Yellow);
}// end of position symbols
//---------------------------------------------------------------------------------------------------
// create the pipdiff symbols
//--------------------------------------------------------------------------------------------------
for ( x=0;x<4;x++)
{
}
alreadydrawn=true;
}// end of the once only code
//----------------------------------------------------------------------------------------------------------
// calculate the sar values and assign appropriately
//----------------------------------------------------------------------------------------------------------
for (x=0;x<4;x++)
{
double sar = iSAR(Symbol(),times[x],par_step,par_max,0);
double sweetsar = NormalizeDouble(sar,2);
double price = NormalizeDouble(iClose(Symbol(),times[x],0),2);
if (sar>iClose(Symbol(),times[x],0))
{
ObjectSetText("trend"+x,CharToStr(Sell),12,"Wingdings",sellcolour);
//ObjectSetText("diffsignals"+x,DoubleToStr(sar-iClose(Symbol(),times[x],0),Digits),10,"Times New Roman",sellcolour);
//ObjectSetText("diffsignals"+x,"" + sweetsar - price,10,"Times New Roman",sellcolour);
}//end of sar up code
else
if (sar<iClose(Symbol(),times[x],0))
{
ObjectSetText("trend"+x,CharToStr(Buy),12,"Wingdings",buycolour);
//ObjectSetText("diffsignals"+x,DoubleToStr(iClose(Symbol(),times[x],0)-sar,Digits),10,"Times New Roman",buycolour);
}// end of sar down code
//ObjectSetText("swingn"+x,DoubleToStr(iHigh(Symbol(),times[x],0)-iLow(Symbol(),times[x],0),Digits),10,"Times New Roman",Yellow);
}// end of sar values
//Alert("sar= "+ sar, "close" +iClose(Symbol(),times[x],0));
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---