1. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

highest question

Discussion in 'Belajar MQL dari Nol' started by ahmed61089, 05 Aug 2020.

  1. ahmed61089

    ahmed61089 Member Credit Hunter

    Equity
    Credit
    Ref Point
    hello

    There something i don't understand. I made a very simple code to test. So basically i want to take the highest and lowest value of yesterday. The code will work only if i run the EA on daily chart. if i put on h1 it will give me the highest and lowest of the last hour. The problem is i am specifying the time frame to D1. anyone know whats wrong?

    HighCandle=High[iHighest(NULL,PERIOD_D1,MODE_HIGH,1,1)];
    LowCandle=Low[iLowest(NULL,PERIOD_D1,MODE_LOW,1,1)];
    Print("Highest ",HighCandle);
    Print("Lowest ",LowCandle);
     
  2. garago

    garago Member Credit Hunter

    Equity
    Credit
    Ref Point
    Try
    HighCandle=iHigh(NULL,PERIOD_D1,iHighest(NULL,PERIOD_D1,MODE_HIGH,1,1));
    Ciao
     
  3. Onyx MIB

    Onyx MIB Member

    Equity
    Credit
    Ref Point
    double YestHigh = iHigh(NULL, PERIOD_D1, 1);
    double YestLow = iLow(NULL, PERIOD_D1, 1);
    datetime open1 = iTime(NULL, PERIOD_D1, 0);
    datetime open2 = iTime(NULL, PERIOD_D1, 1);
    int shift1 = iBarShift(NULL, PERIOD_H1, open1, false);
    int shift2 = iBarShift(NULL, PERIOD_H1, open2, false);
    int candleHighest = iHighest(NULL, PERIOD_H1, MODE_HIGH, (shift2-shift1) , shift1+1);
    int candleLowest = iLowest(NULL, PERIOD_H1, MODE_LOW, (shift2-shift1) , shift1+1);

    PrintFormat("Highest Price : %.5f, index: %d", YestHigh, candleHighest);
    PrintFormat("Lowest Price : %.5f, index: %d", YestLow, candleLowest);


    Buat yang ingin belajar coding MQL, silakan bergabung di group telegram https://t.me/codeMQL
    Cocok bagi pemula yang ingin belajar dari awal dengan contoh yang mudah dipahami.
     
  4. ahmed61089

    ahmed61089 Member Credit Hunter

    Equity
    Credit
    Ref Point
    thank you all for the help
     
    • Like Like x 1
  5. AutoProfit

    AutoProfit Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    you are welcome.

    Buat teman-teman yang ingin belajar lebih serius ttg coding MQL,
    silakan bergabung di https://t.me/codeMQL
    Saya akan sharing pembelajaran pemrogramman EA dengan cara yang berbeda.

    langsung aja klik link https://t.me/codeMQL
     

Share This Page