แนวคิดนี้ถูกสร้างขึ้นโดยAndrey และ ผู้เขียนโค้ด MQL5 คือbarabashkakvn.
การคำนวณ Moving Average โดยใช้ข้อมูลจาก Commodity Channel Index:
//--- สร้าง handle ของตัวชี้วัด iMA handle_iMA=iMA(m_symbol.Name(),Period(),15,0,MODE_EMA,handle_iCCI); //--- ถ้า handle ไม่ถูกสร้าง if(handle_iMA==INVALID_HANDLE) { //--- แจ้งเกี่ยวกับความล้มเหลวและแสดงรหัสข้อผิดพลาด PrintFormat("ไม่สามารถสร้าง handle ของตัวชี้วัด iMA สำหรับสัญลักษณ์ %s/%s, รหัสข้อผิดพลาด %d", m_symbol.Name(), EnumToString(Period()), GetLastError()); //--- หยุดการทำงานของตัวชี้วัด return(INIT_FAILED); }
แนวทางนี้คล้ายกับการเปิดตัวชี้วัด Moving Average ในหน้าต่าง Commodity Channel Index โดยเลือก “ข้อมูลตัวชี้วัดก่อนหน้า” ในพารามิเตอร์ (การใช้ตัวชี้วัดกับข้อมูลของตัวชี้วัดอื่น).
หลักการเปิดและปิดตำแหน่ง:
- ถ้า Moving Average ที่คำนวณจาก Commodity Channel Index ตัดลงผ่าน Commodity Channel Index ทั่วไป จะเปิดตำแหน่ง BUY.
- ถ้า Moving Average ที่คำนวณจาก Commodity Channel Index ตัดขึ้นผ่าน Commodity Channel Index ทั่วไป จะเปิดตำแหน่ง SELL.
- ถ้า Moving Average ที่คำนวณจาก Commodity Channel Index ตัดขึ้นผ่าน Commodity Channel Index ทั่วไป จะปิดตำแหน่ง BUY.
- ถ้า Moving Average ที่คำนวณจาก Commodity Channel Index ตัดลงผ่าน Commodity Channel Index ทั่วไป จะปิดตำแหน่ง SELL.
การทดสอบใน EURUSD, H1:


ความคิดเห็น 0