0-1-Market Buy

Author: Copyright 2014, File45
Orders Execution
It automatically opens orders when conditions are reached
Miscellaneous
It opens Message Boxes to the user
0 Views
0 Downloads
0 Favorites
0-1-Market Buy
#property copyright "Copyright 2014, File45"
#property link      "http://codebase.mql4.com/en/author/file45"
#property show_inputs

#include <stdlib.mqh>
#include <WinUser32.mqh>
#property show_inputs

// Script: 0-1-Buy   

// Default Inputs: Start
extern double Buy_Lots  = 0.01;
extern int Buy_Slippage = 3;
// Default Inputs: Start

int start()
  {
   string BL =  DoubleToStr(Buy_Lots,2);
   string BM =  DoubleToStr(Ask,Digits);
   
   if(MessageBox("BUY : " + BL + " lots at " + BM + " " + Symbol(),
   "Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1);
//----
   int ticket=OrderSend(Symbol(),OP_BUY,Buy_Lots,Ask,Buy_Slippage,0,0,"expert comment",255,0,CLR_NONE);
   if(ticket<1)
     {
      int error=GetLastError();
      Print("Error = ",ErrorDescription(error));
      return;
     }
//----
   OrderPrint();
   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 ---