Miscellaneous
0
Views
0
Downloads
0
Favorites
Price_Line_Alert
//+----------------------------------------------------------------+
//| Price_Line_Alert.mq4 |
//+----------------------------------------------------------------+
#property copyright "forexuser"
#property indicator_chart_window
extern bool ShowBuyLine = true;
extern bool ShowSellLine = true;
extern string BUY_OPTIONS = "###-BUY LINE SETTINGS-###";
extern string BuyLineName="MyBuyLine";
extern color BuyLineColor=Blue;
extern int BuyLineStyle=STYLE_SOLID;
extern int BuyAlert_Pip_Distance=2;
extern string BuyAlertWav="BuyAlertLine.wav";
extern string SELL_OPTIONS = "###-SELL LINE SETTINGS-###";
extern string SellLineName="MySellLine";
extern color SellLineColor=Red;
extern int SellLineStyle=STYLE_SOLID;
extern int SellAlert_Pip_Distance=2;
extern string SellAlertWav="SellAlertLine.wav";
int init()
{
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int counted_bars=IndicatorCounted();
ObjectCreate(BuyLineName, OBJ_HLINE, 0, 0, Ask+(Ask-Bid));
ObjectSet(BuyLineName, OBJPROP_STYLE, BuyLineStyle);
ObjectSet(BuyLineName, OBJPROP_COLOR, BuyLineColor);
double BuyValue = ObjectGet( BuyLineName, OBJPROP_PRICE1);
if (Bid-BuyAlert_Pip_Distance*Point <= BuyValue && Bid+BuyAlert_Pip_Distance*Point >= BuyValue)
PlaySound(BuyAlertWav);
ObjectCreate(SellLineName, OBJ_HLINE, 0, 0, Bid-(Ask-Bid));
ObjectSet(SellLineName, OBJPROP_STYLE, SellLineStyle);
ObjectSet(SellLineName, OBJPROP_COLOR, SellLineColor);
double SellValue = ObjectGet( SellLineName, OBJPROP_PRICE1);
if (Bid-SellAlert_Pip_Distance*Point <= SellValue && Bid+SellAlert_Pip_Distance*Point >= SellValue)
PlaySound(SellAlertWav);
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
---