ema_smma
Indicators Used
Moving average indicator
Miscellaneous
Uses files from the file systemIt writes information to file
0 Views
0 Downloads
0 Favorites
ema_smma
#property show_inputs

extern int _SMMA_PERIOD = 21;

int start()
  {
   int handle = FileOpen( "ema_smma.csv", FILE_CSV | FILE_WRITE, " " );
   for( int i = Bars - 1; i >= 0; i-- )
   {
      double diff = iMA( NULL, 0, _SMMA_PERIOD,       0, MODE_SMMA, PRICE_CLOSE, i ) - 
                    iMA( NULL, 0, 2*_SMMA_PERIOD - 1, 0, MODE_EMA,  PRICE_CLOSE, i ); 
      double diff_n = NormalizeDouble( diff, 8 );              
      FileWrite( handle, "i = ", i, "\t\t difference = ", diff_n );
   }
   FileClose( handle );   
   return(0);
  }

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