Power_of_USD

Author: Jan Opocensky
Price Data Components
Series array that contains close prices for each bar
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Power_of_USD
ÿþ//+------------------------------------------------------------------+

//|                                                 Power of USD.mq4 |

//|                                                    Jan Opocensky |

//|                                                                  |

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

#property copyright "Jan Opocensky"

#property link      ""

#property version   "R050120"

#property strict

#property indicator_separate_window

#property indicator_buffers    1

#property indicator_color1     Red



double Power_of_USD_Buffer[];

int i;

int pos;



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

//| Custom indicator initialization function                         |

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

int OnInit()

  {

//--- indicator buffers mapping ------------------

   IndicatorBuffers(1);

   SetIndexBuffer(0,Power_of_USD_Buffer);

   SetIndexStyle(0,DRAW_LINE,EMPTY,2);

//------------------------------------------------

//********************************************************************



//********************************************************************

   return(INIT_SUCCEEDED);

  }

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

//| Custom indicator iteration function                              |

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

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

//----------------------------------------



pos=Bars-IndicatorCounted();



//----------------------------------------

   

for (i=0;i<pos;i++)

{

   

   Power_of_USD_Buffer[i]= 

   

   (-iClose("EURUSD",0,i)- // REVERZNÍ PÁR

   iClose("AUDUSD",0,i)- // REVERZNÍ PÁR

   iClose("NZDUSD",0,i)- // REVERZNÍ PÁR

   iClose("GBPUSD",0,i)+ // REVERZNÍ PÁR

   (iClose("USDJPY",0,i)/100) +

   iClose("USDCAD",0,i)+

   iClose("USDCHF",0,i))/7

   ;

   

   

   

}    

//   

   

//--- return value of prev_calculated for next call

   return(rates_total);

  }

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

//| Timer function                                                   |

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

void OnTimer()

  {

//---

   

  }

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

//| ChartEvent function                                              |

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

void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam)

  {

//---

   

  }

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

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---