// ------------ site inormation -------------
//FILTER NAME : free filter HF-112
// User: Mostafa Ejarestaghi
// Date: 1399/11/03
// UPDATE: 1400/11/18
// version : 1.1.2
// website : www.hooshefaal.ir 
// Email : hooshefaal@gmail.com
//Telegram Channel : @hooshefaal
//Telegram Admin : @hooshefaal_support
// Instagram Page :  @hooshefaal.ir
//whatsapp number :  09364549266
true == function () {
    (cfield0)="";
    (cfield1)="";
    (cfield2)="";
    Hooshefaal();
    var message = "";
    var pe = 0;
    var eps = 0;
    var max = [ih][0].PriceMax;
    var min = [ih][0].PriceMin;
    for (var ipos = 1; ipos < 15; ipos++) {
        if (max < [ih][ipos].PriceMax) max = [ih][ipos].PriceMax;
    }
    for (var ipos = 0; ipos < 14; ipos++) {
        if (min > [ih][ipos].PriceMin) min = [ih][ipos].PriceMin;
    }
    K = ((((pc) - min) / (max - min)) * 100);
    D = (K + ((([ih][0].PClosing - min) / (max - min)) * 100) + ((([ih][1].PClosing - min) / (max - min)) * 100)) / 3;

    if (Math.round(K) <= 30) {

        message += "<span style='background-color:yellow;'>سظح حمایتی</span>";

    }
    if ((pe) < 10 && (pe) > 0) {
        pe = "<span style='background-color:green;'>P/E : " + (pe) + "</span>";
    } else {
        pe = "P/E : " + (pe);
    }
    if ((eps) > 2000) {
        eps = "<span style='background-color:green;'>EPS : " + (eps) + "</span>";
    } else {
        eps = "EPS : " + (eps);
    }
    (cfield0) = (bvol);
    (cfield1) = (z) * (pc);
    (cfield2) = "تعداد سهام : " + (z) + "  " + pe + "  " + eps + " " + message;
    return true;

}()
//=========================END FUNCTION =========================
function Hooshefaal() {
    var HelpLink = "https://www.hooshefaal.ir/دانلود-رایگان-فیلتر-تحلیل-بنیادی-سهام-hf/";
    var FilterName = "HF-112";

    var column1 = "A", column2 = "B", column3 = "پیام", column4 = "", column5 = "";
    var my_data_title0 = '<div style = "direction:rtl;";>';
   my_data_title0 +=' <span style = "border: 1px solid gray;width: 100%;display: inline-block;text-align: center;color: #000;background: #FFAB73;font-weight: normal;"> ' + column1 + '</span>'
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 42%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #FFD700 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://www.hooshefaal.ir/category/vip-filter/gold/" title="فیلتر های طلایی سایت هوش فعال" target="_blank"><b>💎فیلتر های ویژه💎</b></a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl;display: inline-block;background: #F6F7BF;font-weight: normal;text-align: center;border: 0 solid red;border-radius: 6px;padding: 3px;top: 45%;position: fixed;font-family: Tahoma;font-size: 12px;background-color: #06FF00 !important;box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue;width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://www.hooshefaal.ir/category/%d9%81%db%8c%d9%84%d8%aa%d8%b1-%d9%86%d9%88%db%8c%d8%b3%db%8c-%d8%a8%d9%88%d8%b1%d8%b3/free-filter/"title="دانلود رایگان فیلتر های بورسی" target="_blank">دانلود فیلترهای رایگان</a></span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 48%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #06FF00 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://www.hooshefaal.ir/category/indicator-download/" title=" دانلود رایگان اندیکاتور" target="_blank">دانلود رایگان اندیکاتور </a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 51%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #A4EBF3 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;">سفارش <a href="https://www.hooshefaal.ir/expert-order/" title="سفارش اکسپرت" target="_blank">اکسپرت</a> و <a href="https://www.hooshefaal.ir/tsetmc-filter-order/" title="سفارش فیلتر" target="_blank">فیلتر </a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 54%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #A4EBF3 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://t.me/hooshefaal/" title="کانال تلگرام هوش فعال" target="_blank">کانال تلگرام هوش فعال</a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 57%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #ffad00 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://www.youtube.com/channel/UCMWCAmtUbiZcF4d7vZVtjfg" title="کانال یوتیوب هوش فعال" target="_blank">یوتیوب هوش فعال </a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 60%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #ffcc00 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="https://www.aparat.com/vitanet" title="کانال آپارات  هوش فعال" target="_blank">آپارات هوش فعال </a> </span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 63%;position: fixed;font-family: Tahoma; font-size: 12px; background-color: #ffff00 !important;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue; width: 150px;animation: NotificationAnim 2s infinite linear;"><b><a href="' + HelpLink + '" title="لینک آموزش شیوه استفاده از این فیلتر" target="_blank">راهنمای این فیلتر</a> </b></span>';
    my_data_title0 += '<span style="left: 10px;direction: rtl; display: inline-block; background: #F6F7BF;font-weight: normal; text-align: center;border: 0 solid red;border-radius: 6px; padding: 3px;top: 66%;position: fixed;font-family: Tahoma; font-size: 25px; background-color: #ff5;  box-shadow: 0 2px 5px rgb(0 0 0 / 50%);color: Blue !important; width: 150px;animation: NotificationAnim 2s infinite linear;"><a href="' + HelpLink + '" title=" سایت  هوش فعال" target="_blank"><b>هوش فعال</b><br><b>' + FilterName + '</b></a> </span></div>';

   var my_data_title1 = '<span style = "border: 1px solid gray;width: 100%;display: inline-block;text-align: center;color: #000;background: #FFD384;font-weight: normal;"> ' + column2 + '</span>'
    var my_data_title2 = '<span style = "border: 1px solid gray;width: 100%;display: inline-block;text-align: right;color: #000;background: #FFF9B0;font-weight: normal;"> ' + column3 + '</span>'

    //cfield Titel
    var cfield0_title = my_data_title0, cfield1_title = my_data_title1, cfield2_title = my_data_title2;
    //Columns width
    var wc0 = "100px", wc1 = "100px", wc2 = "1200px";

    var title = document.getElementsByClassName("t0head");
    for (var i = 0; i < title.length; i++) {
        if (title[i].outerHTML.includes("cfield0")) {
            title[i].innerHTML = cfield0_title;
           // title[i].style.width = wc0;
            title[i].style.fontWeight = "normal";
        }

        else if (title[i].outerHTML.includes("cfield1")) {
            title[i].innerHTML = cfield1_title;
         //   title[i].style.width = wc1;
            title[i].style.fontWeight = "normal";
        }
        else if (title[i].outerHTML.includes("cfield2")) {
            title[i].innerHTML = cfield2_title;
           // title[i].style.width = wc2;
            title[i].style.fontWeight = "normal";
        }
    }

}