SL_Breakeven

Author: © 2018, Alexey Viktorov
1 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