SL_Breakeven

Author: © 2018, Alexey Viktorov
0 Views
0 Downloads
0 Favorites
SL_Breakeven
ÿþ/********************************************************************\

|                                                   SL_Breakeven.mq5 |

|                                                           Viktorov |

|                       https://www.mql5.com/ru/users/alexeyvik/news |

\********************************************************************/

#property copyright "© 2018, Alexey Viktorov"

#property link      "https://www.mql5.com/ru/users/alexeyvik/news"

#property version   "1.00"

#include <SL_Breakeven.mqh>

CTest be;

#include <Trade/Trade.mqh>

CTrade Trade;



input int     LevelBreakeven  = 70; //  Distance to travel in breakeven

input int     StopLoss_Pips   = 30; //  Distance from stop loss to price open



/*******************Expert initialization function*******************/

int OnInit()

{

 

   return(INIT_SUCCEEDED);

}/*******************************************************************/



/************************Expert tick function************************/

void OnTick()

{

  int total = PositionsTotal();

  if(total == 0)

   Trade.Sell(0.1);

  be.SL_Breakeven(LevelBreakeven, StopLoss_Pips);

   Comment("");

}/*******************************************************************/



/******************Expert deinitialization function******************/

void OnDeinit(const int reason)

{

 Comment("");

}/*******************************************************************/

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