วันอังคารที่ 26 เมษายน พ.ศ. 2559

แก้ปัญหา Profit Table ไม่ตรงกัน


จากที่เคยนำ Code แสดง Profit Table ในรูปแบบต่างๆคือ
  1. yearly/monthly profit table
  2. yearly profit bar chart
  3. average monthly profit bar chart 
แต่ปัญหาที่พบคือ ค่า Profit Table ของ Code ตัวอย่างไม่ตรงกับ Profit Table ใน Report Backtest  ตัวเดิม

หลังจากสอบถามไปกับทาง Amibroker Support แล้วได้รับคำตอบว่า คำนวณเดือน และปีใหม่ต่างกัน
ทำให้ผลลัพท์ต่างกัน

หากต้องการปรับให้ตรงกัน ลองเปลี่ยน Code ตามตัวอย่างด้านล่าง

Code จากตัวอย่าง
YearChange = yr != Ref( yr, -1 );
MonChange = mo != Ref( mo, -1 );
 
ให้เปลี่ยนเป็น
YearChange = yr != Ref( yr, 1 );
MonChange = mo != Ref( mo, 1 ); 

โหลด Source Code
https://www.amibroker.com/kb/2007/10/11/low-level-gfx-example-yearlymonthly-profit-chart/











ไม่มีความคิดเห็น:

แสดงความคิดเห็น