FXOpen Broker

10+ years’
experience in FX

VISIT WEBSITE

Trading Accounts

ECN, STP,
Micro, Crypto

START TRADING

Free Demo

Practice Forex trading
risk free

OPEN DEMO ACCOUNT

PAMM Technology

Become a Master
or a Follower

JOIN PAMM SERVICE
Page 7 of 7 FirstFirst ... 34567
Results 91 to 93 of 93

Thread: MQL4 заметки от eevviill

  1. #91
    Moderator cool user eevviill's Avatar
    Join Date
    Jul 2015
    Location
    Бандерівці
    Posts
    5,491
    Thanks
    1,585
    Thanked 1,940 Times in 1,788 Posts

    Default Заметка 88 - алерт универсальный

    Можно применять по тикам и по барам.
    Можно применять если сигнал появляется на разных барах(не только на прошлом).

    PHP Code:
     input string emp3 "///////////Alerts settings/////////////";
     
    input bool use_alert false;
     
    input string up_alert "UP";
     
    input string down_alert "DOWN";

    datetime last_alert_time=Time[1];
    ...
       
    //Alerts
     
    if(use_alert)
     {  
      for(
    int i=1;i<Bars-20;i++) 
     {
     if(
    Time[i]<=last_alert_time) break;
     if(
    up_arr[i]!=EMPTY_VALUE) {Alert(_Symbol," ",_Period," ",up_alert);last_alert_time=Time[i];break;}
     if(
    down_arr[i]!=EMPTY_VALUE) {Alert(_Symbol," ",_Period," ",down_alert);last_alert_time=Time[i];break;}
     }
     } 
    Last edited by eevviill; 10-13-2021 at 11:38 AM.

  2. #92
    Moderator cool user eevviill's Avatar
    Join Date
    Jul 2015
    Location
    Бандерівці
    Posts
    5,491
    Thanks
    1,585
    Thanked 1,940 Times in 1,788 Posts

    Default Заметка 89 - диапазон уровней в подокне индикатора

    Если нужно в подокне индикатора нарисовать несколько уровней с одинаковыми отступами, то можно воспользоватся такой конструкцией.

    PHP Code:
     input int levels 10;
     
    input double high_low_level 50;
     ...
     
    int OnInit()
      {
     
    double min=high_low_level/levels*2;
     for(
    int i=0;i<levels;i++)
     {
     
    SetLevelValue(i,high_low_level-min*i);
     }

       return(
    INIT_SUCCEEDED);
      } 
    Last edited by eevviill; 12-31-2021 at 11:22 AM.

  3. #93
    Moderator cool user eevviill's Avatar
    Join Date
    Jul 2015
    Location
    Бандерівці
    Posts
    5,491
    Thanks
    1,585
    Thanked 1,940 Times in 1,788 Posts

    Default Заметка 90 - подсчёт данных в периоде большего ТФ

    Если нужно подсчитать данные на текущем графике разбитого на периоды старшего ТФ то можно это делать с помощью такой конструкции.

    PHP Code:
     input int Periods 8;
     
    input ENUM_TIMEFRAMES TF PERIOD_D1;

    int plus=iBarShift(_Symbol,PERIOD_CURRENT,iTime(_Symbol,TF,2))-iBarShift(_Symbol,PERIOD_CURRENT,iTime(_Symbol,TF,1));
    ...
       
    //main
     
    int bar=IndicatorCounted()==0?Periods:2;
       
    int i;

     for(
    int p=bar;p>=0;p--) 
     {
     if(
    p>iBars(_Symbol,TF)-20p=iBars(_Symbol,TF)-20;
     
     
    i=iBarShift(_Symbol,PERIOD_CURRENT,iTime(_Symbol,TF,p),true);
     if(
    i==-1i=iBarShift(_Symbol,PERIOD_CURRENT,iTime(_Symbol,TF,p),false)-1;
     
      
    //
      
    for(int x=i;x>i-plus && x>=0;x--)
      {
      
    //Count
      
    }

      } 
    Last edited by eevviill; 01-09-2022 at 10:25 AM.

Page 7 of 7 FirstFirst ... 34567

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Disclaimer
2022 © FXOpen. All rights reserved. Various trademarks held by their respective owners.

Risk Warning: Trading on the Forex market involves substantial risks, including complete possible loss of funds and other losses and is not suitable for all members. Clients should make an independent judgment as to whether trading is appropriate for them in the light of their financial condition, investment experience, risk tolerance and other factors.

FXOpen Markets Limited, a company duly registered in Nevis under the company No. C 42235. FXOpen is a member of The Financial Commission.

FXOpen AU Pty Ltd., a company authorised and regulated by the Australian Securities & Investments Commission (ASIC). AFSL 412871ABN 61 143 678 719.

FXOpen Ltd. a company registered in England and Wales under company number 07273392 and is authorised and regulated by the Financial Conduct Authority (previously, the Financial Services Authority) under FCA firm reference number 579202.

FXOpen EU is a trading name of FXOpen EU Ltd. FXOpen EU Ltd is authorized and regulated by the Cyprus Securities and Exchange Commission (CySEC) under license number 194/13.

FXOpen does not provide services for United States residents.

Join us