Author: Copyright � 2016, ������� ��������
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
Indicators Used
Relative strength index
0 Views
0 Downloads
0 Favorites

Profitability Reports

GBP/CAD Oct 2024 - Jan 2025
59.00 %
Total Trades 150
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -2.32
Gross Profit 492.59
Gross Loss -840.23
Total Net Profit -347.64
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
48.00 %
Total Trades 98
Won Trades 19
Lost trades 79
Win Rate 0.19 %
Expected payoff -4.18
Gross Profit 380.00
Gross Loss -790.00
Total Net Profit -410.00
-100%
-50%
0%
50%
100%
cm_RSI
//+------------------------------------------------------------------+
//|                                                          RSI.mq4 |
//|                               Copyright © 2016, Õëûñòîâ Âëàäèìèð |
//|                                                cmillion@narod.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2016, Õëûñòîâ Âëàäèìèð"
#property link      "cmillion@narod.ru"
#property strict
#property description "ñîâåòíèê ïî RSI"
#property description "sell ïðè ïåðåñå÷åíèå ñâåðõó âíèç 70 è íà buy ñíèçó ââåðõ 30"
#property description "ñòîïû è òåéêè ìîæíî âûñòîâèòü â íàñòðîéêàõ ñîâåòíèêà"
//--------------------------------------------------------------------
extern int     period_RSI           = 14,
               stoploss             = 100,
               takeprofit           = 200,
               slippage             = 10,
               buy_level            = 30,
               sell_level           = 70,
               Magic                = 777;
extern double  Lot                  = 0.1;
//--------------------------------------------------------------------
void OnTick()
{
   for (int i=0; i<OrdersTotal(); i++)
      if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         if (OrderSymbol()==Symbol() && Magic==OrderMagicNumber()) return;
   double RSI0  = iRSI(NULL,0,period_RSI,PRICE_OPEN,0);
   double RSI1  = iRSI(NULL,0,period_RSI,PRICE_OPEN,1);
   double SL=0,TP=0;
   if (RSI0 > buy_level && RSI1 < buy_level)
   {
      if (takeprofit!=0) TP  = NormalizeDouble(Ask + takeprofit*Point,Digits);
      if (stoploss!=0)   SL  = NormalizeDouble(Ask - stoploss*  Point,Digits);     
      if (OrderSend(Symbol(),OP_BUY, Lot,NormalizeDouble(Ask,Digits),slippage,SL,TP,NULL,Magic)==-1) Print(GetLastError());
   }
   if (RSI0 < sell_level && RSI1 > sell_level)
   {
      if (takeprofit!=0) TP = NormalizeDouble(Bid - takeprofit*Point,Digits);
      if (stoploss!=0)   SL = NormalizeDouble(Bid + stoploss*  Point,Digits);            
      if (OrderSend(Symbol(),OP_SELL,Lot,NormalizeDouble(Bid,Digits),slippage,SL,TP,NULL,Magic)==-1) Print(GetLastError());
   }
}
//--------------------------------------------------------------------

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