SwapMinorPairs

Author: Copyright 2020, FXFledgling Forex Study Group
0 Views
0 Downloads
0 Favorites
SwapMinorPairs
//+------------------------------------------------------------------+
//|                                               SwapMinorPairs.mq4 |
//|                    Copyright 2020, FXFledgling Forex Study Group |
//|                     https://www.facebook.com/groups/FXFledgling/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, FXFledgling Forex Study Group"
#property link      "https://www.facebook.com/groups/FXFledgling/"
#property version   "1.00"
#property strict

//=====================================================================//
//    Variables
//=====================================================================//
int    PairCount =21;
string Pairs[21]=
  {
   "EURGBP","EURAUD","EURNZD","EURCAD","EURCHF","EURJPY","GBPAUD",
   "GBPNZD","GBPCAD","GBPCHF","GBPJPY","AUDNZD","AUDCAD","AUDCHF",
   "AUDJPY","NZDCAD","NZDCHF","NZDJPY","CADCHF","CADJPY","CHFJPY"
  };
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   string c = "\n\nSWAP Info - Major Pairs\n";
   for(int x=0;x<PairCount; x++)
     {
      string s = SwapIs(MarketInfo(Pairs[x],MODE_SWAPSHORT));
      string b = SwapIs(MarketInfo(Pairs[x],MODE_SWAPLONG));
      c+="\n"+Pairs[x]+":  Short "+s+",  Long "+b;
     }
   Comment(c);
//---
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   Comment("");
  }
//+------------------------------------------------------------------+
//| Status                                                           |
//+------------------------------------------------------------------+
string SwapIs(double v)
  {
//---
   string s="Zero";
   if(v>0) s="Positive";
   else if(v<0) s="Negative";
   return(s);
  }
//+------------------------------------------------------------------+

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 ---