Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

MySystem - expert for MetaTrader 5

Published by:
Vladimir Karputov
Views:
3755
Rating:
(12)
Published:
2018.10.25 15:46
MySystem.mq5 (33.98 KB) view
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The author of the ideaCollector

MQL5 code author: barabashkakvn

The EA only operates when a new bar appears. A trading signal from the iBullsPower (Bulls Power) and iBearsPower (Bears Power) indicators is considered only if the market has no positions opened by the EA (the search is performed by the current symbol and the current unique EA identifier - magic number).

Both indicators feature only one setting - Bulls and Bears: averaging period. Trading signal forming algorithm: data from two bars - Bar current and Bar current+1 - are taken in both indicators and the values are divided by 2

   double prev = ((bears[1]+bulls[1])/2.0);
   double curr = ((bears[0]+bulls[0])/2.0);

If the average value on the previous bar is less than on the current one, open BUY:

      if(prev<curr && curr<0)
        {
         //ClosePositions(POSITION_TYPE_SELL);
         double sl=(InpStopLoss==0)?0.0:m_symbol.Ask()-ExtStopLoss;
         if(sl>=m_symbol.Bid()) // incident: the position isn't opened yet, and has to be already closed
           {
            PrevBars=0;
            return;
           }
         double tp=(InpTakeProfit==0)?0.0:m_symbol.Ask()+ExtTakeProfit;
         OpenBuy(sl,tp);
         return;
        }

If the average value on the previous bar exceeds the current one, open SELL:

      if(prev>curr && curr>0)
        {
         //ClosePositions(POSITION_TYPE_BUY);
         double sl=(InpStopLoss==0)?0.0:m_symbol.Bid()+ExtStopLoss;
         if(sl<=m_symbol.Ask()) // incident: the position isn't opened yet, and has to be already closed
           {
            PrevBars=0;
            return;
           }
         double tp=(InpTakeProfit==0)?0.0:m_symbol.Bid()-ExtTakeProfit;
         OpenSell(sl,tp);
         return;
        }

EURUSD, M15:

MySystem

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/22016

DeMarker_Histogram_Vol_HTF DeMarker_Histogram_Vol_HTF

DeMarker_Histogram_Vol indicator with the timeframe selection option available in input parameters

Hans_Indicator_x4 Hans_Indicator_x4

The indicator of expanding time zone corridors with two corridors

XHullTrend_Digit XHullTrend_Digit

HullTrend indicator with additional smoothing of the Hull moving average and rounding the values by the number of digits fixed in the input variables

Hans_Indicator Hans_Indicator

The indicator of expanding time zone corridors