0
Views
0
Downloads
0
Favorites
DavidF_Hedge_chart
//+------------------------------------------------------------------+
//| DavidF_Hedge.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
// INFo: http://kreslik.com/forums/viewtopic.php?t=307&postdays=0&postorder=asc&start=0
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorShortName("Hedge EUR/USD/CHF chart");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars<100) return;
//----
int i;
double EUR, USD, CHF, FPI;
RefreshRates();
EUR = MarketInfo("EURUSD",MODE_BID);
USD = MarketInfo("USDCHF",MODE_BID);
CHF = MarketInfo("EURCHF",MODE_ASK);
FPI = EUR * USD * (1/ CHF);
ObjectDelete("EURUSD");
ObjectDelete("USDCHF");
ObjectDelete("EURCHF");
ObjectCreate("EURUSD", OBJ_HLINE, 0, Time[0], EUR);
ObjectSet("EURUSD", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("EURUSD", OBJPROP_COLOR, DarkOrange);
ObjectCreate("USDCHF", OBJ_HLINE, 0, Time[0], USD);
ObjectSet("USDCHF", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("USDCHF", OBJPROP_COLOR, RoyalBlue);
ObjectCreate("EURCHF", OBJ_HLINE, 0, Time[0], CHF);
ObjectSet("EURCHF", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("EURCHF", OBJPROP_COLOR, LawnGreen);
Comment(
"\n FPI: ", DoubleToStr(FPI,6),
"\n EUR/USD: ", DoubleToStr(EUR,4),
"\n USD/CHF: ", DoubleToStr(USD,4),
"\n EUR/CHF: ", DoubleToStr(CHF,4));
//----
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
---