Author: Copyright � 2004, MetaQuotes Software Corp.
Try
Indicators Used
Moving average indicatorMoving average indicator
0 Views
0 Downloads
0 Favorites
Try
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                        trade.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"

#include <stdlib.mqh>
#include <WinUser32.mqh>
//+------------------------------------------------------------------+
//| script "trading for all money"                                   |
//+------------------------------------------------------------------+
int start()
  {
//----
   double testarray[10];
   double manualSMA=0;
   for (int cnt=1; cnt<10; cnt++)
      {
      testarray[cnt-1]=Close[cnt];
      manualSMA=manualSMA+Close[cnt];
      //Print (testarray[cnt-1]);
      }

   manualSMA=manualSMA/9;

   Print("IMA:         ",DoubleToStr(iMA(NULL,0,9,0,MODE_SMA,PRICE_CLOSE,1),8));
   Print("IMAonarray:  ",DoubleToStr(iMAOnArray(testarray,0,9,0,MODE_SMA,0),8));
   Print("manualSMA:   ",DoubleToStr(manualSMA,8));


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