SFX Trend Or Range Indicator

0
(0)
ชื่อ:
SFX Trend Or Range Indicator
ผู้เขียน: แบร์โรว์บอย (2011.07.12 10:38)
ดาวน์โหลดแล้ว: 11128
ดาวน์โหลด:
SFX Trend Or Range Indicator 1
SFX TOR.mq4 (6.6 Kb) ดู
The Trend Or Range Indicator (TOR)

A remarkably simple but very useful indicator. Earlier and clearer signals than ADX or VHF. More positive ranging signal than any other indicators.

Old conventional theory says when StdDev above ATR then market trending.

I say this idea may be OK for stocks & commodites but for the harmonics of Forex market we need something quicker and clearer. Also never forget time of day in relation to the pairs main movements.

SFX Trend Or Range Indicator 2

Yellow = StdDev
Aqua = ATR
Red = Smoothed Moving Average of the StdDev
การใช้งาน:

คู่ไหนก็ได้, กรอบเวลาใดก็ได้. Best used on majors and M15 period or higher

  • Yellow breaks above Red when below Aqua = Trend building
  • Yellow breaks below Red when above Aqua = Trend exhausting
  • Yellow below Red when below Aqua = Ranging/Sideways market

Details:

Code shows how to apply a Moving Average to almost any indicator.

Some sample code snippets below to show you how to call this indicator in an EA.

// Example EA code
extern int AgedPeriodSwitch = 5;   // 1=M1 2=M5 -- 9=MN1 Enables easy period value changing in optimizer ;)

// Settings for SFX TOR
 int TOR.ATR.Period=12;        // D1=20
 int TOR.StdDev.MA.Period=12;  // D1=20
 int TOR.StdDev.MA.Shift=0;    //
 int TOR.StdDev.MA.Method = 0; // 0=SMA 1=EMA 2=Smoothed 3=Linear Weighted
 int TOR.StdDev.MA.Price = 0;  // 0 Close price, 
                               // 1 Open price, 
                               // 2 High price, 
                               // 3 Low price, 
                               // 4 Median price, (สูง+ต่ำ)/2, 
                               // 5 Typical price, (สูง+ต่ำ+ปิด)/3, 
                               // 6 Weighted close price, (สูง+ต่ำ+ปิด+ปิด)/4

 int TOR.MA.Fast.Period = 3;
 int TOR.MA.Fast.Method = 2;   //  0=SMA 1=EMA 2=Smoothed 3=Linear Weighted
 int TOR.MA.Fast.Shift = 0;

bool bTrendEnd;

int start()
 {

 bTrendEnd = IsTrendFading(AgedPeriodSwitch);

 ถ้า (IsNewBar)
  ถ้า (bTrendEnd) CloseYourTrendingOrders();
   ....
   ....

 return (0);
 }

bool IsTrendFading(int iPeriodSwitch)
 {
  int iPeriodToUse;
  string strSymbol;

  strSymbol = Symbol();

  ถ้า (iPeriodSwitch == 0) iPeriodToUse = 0; // เช่น. the current chart period of the EA
  else iPeriodToUse = PeriodSwitcher(iPeriodSwitch); 

  double Aqua_1 = iCustom(strSymbol, iPeriodToUse, "SFX TOR", strSymbol, TOR.ATR.Period,TOR.StdDev.MA.Period,TOR.StdDev.MA.Shift,
                          TOR.StdDev.MA.Method,TOR.StdDev.MA.Price,TOR.MA.Fast.Period,TOR.MA.Fast.Method,TOR.MA.Fast.Shift, 0, 1);
  double Yellow_1 = iCustom(strSymbol, iPeriodToUse, "SFX TOR", strSymbol, TOR.ATR.Period,TOR.StdDev.MA.Period,TOR.StdDev.MA.Shift,
                            TOR.StdDev.MA.Method,TOR.StdDev.MA.Price,TOR.MA.Fast.Period,TOR.MA.Fast.Method,TOR.MA.Fast.Shift, 1, 1);
  double Red_1 = iCustom(strSymbol, iPeriodToUse, "SFX TOR", strSymbol, TOR.ATR.Period,TOR.StdDev.MA.Period,TOR.StdDev.MA.Shift,
                            TOR.StdDev.MA.Method,TOR.StdDev.MA.Price,TOR.MA.Fast.Period,TOR.MA.Fast.Method,TOR.MA.Fast.Shift, 2, 1);

  ถ้า (Yellow_1 > Aqua_1)
   ถ้า (Red_1 > Aqua_1)
    ถ้า (Yellow_1 < Red_1) return (จริง);

  return (เท็จ);
 }

int PeriodSwitcher(int iSP)
 {
  // Takes a number 1-9 returns a chart period
  int iP=0;

   switch (iSP) 
   {
    case 1:
     iP=PERIOD_M1;
     break;

    case 2:
     iP=PERIOD_M5;
     break;

    case 3:
     iP=PERIOD_M15;
     break;

    case 4:
     iP=PERIOD_M30;
     break;

    case 5:
     iP=PERIOD_H1;
     break;

    case 6:
     iP=PERIOD_H4;
     break;

    case 7:
     iP=PERIOD_D1;
     break;

    case 8:
     iP=PERIOD_W1;
     break;

    case 9:
     iP=PERIOD_MN1;
     break;
   }  

 return(iP);
 }

Do not mail me if this EA sample code doesnt compile - is only pseudo-code!!!

โพสต์นี้มีประโยชน์เพียงใด?

คลิกที่ดาวเพื่อให้คะแนน!

คะแนนเฉลี่ย 0 / 5. นับคะแนนเสียง: 0

ยังไม่มีคะแนนโหวต! เป็นคนแรกที่ให้คะแนนโพสต์นี้.

ขออภัยที่โพสต์นี้ไม่มีประโยชน์สำหรับคุณ!

ให้เราปรับปรุงโพสต์นี้!

บอกเราว่าเราจะปรับปรุงโพสต์นี้ได้อย่างไร?



ผู้เขียน: ทีมงาน Forex Wiki
เราคือทีมผู้ซื้อขาย Forex ที่มีประสบการณ์สูง [2000-2023] ที่อุทิศตนเพื่อใช้ชีวิตในแบบของเรา. วัตถุประสงค์หลักของเราคือการได้รับอิสรภาพทางการเงินและอิสรภาพ, และเราได้ติดตามการศึกษาด้วยตนเองและได้รับประสบการณ์ที่กว้างขวางในตลาด Forex เพื่อเป็นหนทางในการบรรลุวิถีชีวิตที่ยั่งยืนด้วยตนเอง.