Firestats v0.5

Author: Copyright � 2005, TraderSeven
Indicators Used
Moving average indicator
Miscellaneous
Uses files from the file systemIt writes information to file
0 Views
0 Downloads
0 Favorites
Firestats v0.5
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+-----------------------------------------------------------------------------+
//|                              Firestats v0.5 - Output data for stat analysis |
//+-----------------------------------------------------------------------------+
#property copyright "Copyright © 2005, TraderSeven"
#property link      "TraderSeven@gmx.net"

//----------------------- USER INPUT
extern int MA_length = 10;
extern int MAtype=0;//0=close, 1=HL		 
extern double Percent = 0.3;
extern int TakeProfit = 30;
//-----
int UpActive=0;
int handle;
handle=FileOpen("C:\Documents and Settings\JustMe\Desktop\FireStats.csv", FILE_CSV|FILE_WRITE, ';');


//----------------------- MAIN PROGRAM LOOP
int start()
{

/////////// BUG BUG BUGGY
if((iMA(NULL,0,MA_length,0,MODE_SMA,PRICE_OPEN,0)*(1+Percent/100))<High[0] && UpActive==0)// detect x-over
  {
      Comment("Bling blong");
  double UpEntry=iMA(NULL,0,MA_length,0,MODE_SMA,PRICE_OPEN,0)*(1+Percent/100);
  double UpMax=High[0];
  double UpTarget=(UpMax+UpEntry)/2-(TakeProfit*Point);
  datetime OrderOpenDate=OrderOpenTime();
  UpActive=1;
  }

if(UpActive==1)// check active trades
  {
/////////// BUG BUG BUGGY
  if(Low[0]<UpTarget)// check if ProfitTarget is reached
    {
    Comment("Writing to file....");
    //Target is reached. Now write data to file.
    int PipDD=UpMax-UpEntry;
    datetime OrderCloseDate=OrderCloseTime();
    FileWrite(handle,PipDD,TimeToStr(OrderOpenDate),TimeToStr(OrderCloseDate));
    UpActive=0;//flag trade as closed
    }
  
  if(High[0]>UpMax)// update target
    {
    UpMax=High[0];
    UpTarget=(UpMax+UpEntry)/2-(TakeProfit*Point);
    }
  }  
  





}

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