logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
CN001532  
#1 Posted : Monday, August 22, 2005 3:47:42 AM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

If been having a devil of a time trying to calculate the actual number of degrees of the slope of the 34 EMA and 25 LSMA. I've got some opensource AMIbroker code and was able to get some information from www.metastocktools.com which get me close but not quite there. I have no trouble creating an exploration using the slope, to produce an equivalent results that I require, however I really would like to be able to calculate the actual number of degrees of both slopes for other purposes. A simple atan function of the slope does not do the trick. Posted below is the relavent open source amibroker code that caclulates the actual number of degrees of the angle of the 34 ema and 25 LSMA. Any help would be most appreciated. I would like to replicate these in Metastock: EMA34 = EMA(C,34); PI = 3.141593; periods = 30; HighHigh = HHV(H, periods); LowLow = LLV(L, periods); range = 25 / (HighHigh - LowLow) * LowLow; x1_EMA34 = 0; x2_EMA34 = 2; y1_EMA34 = 0; y2_EMA34 = (Ref(EMA34, -2) - EMA34) / Avg * range; c_EMA34 = sqrt((x2_EMA34 - x1_EMA34)*(x2_EMA34 - x1_EMA34) + (y2_EMA34 - y1_EMA34)*(y2_EMA34 - y1_EMA34)); angle_EMA34 = round(180 * acos((x2_EMA34 - x1_EMA34)/c_EMA34) / PI); x1_LSMA25 = 0; x2_LSMA25 = 2; y1_LSMA25 = 0; y2_LSMA25 = (Ref(LSMA25, -2) - LSMA25) / Avg * range; c_LSMA25 = sqrt((x2_LSMA25 - x1_LSMA25)*(x2_LSMA25 - x1_LSMA25) + (y2_LSMA25 - y1_LSMA25)*(y2_LSMA25 - y1_LSMA25)); angle_LSMA25 = round(180 * acos((x2_LSMA25 - x1_LSMA25)/c_LSMA25) / PI); I tried using/modifying the following code from metastocktools.com with no luck: MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula below. ============================ Linear Regression true slope ============================ ---8<--------------------------- { Linear Regression true Slope v3.5 } { -100~+100% / -90~+90 degrees } { ©Copyright 2003-2004 Jose Silva } { http://www.metastocktools.com } pds:= Input("Linear Regression periods",2,2520,21); pds1:= Input("Lin Reg Signal periods",1,252,5); x:=Input("Open=1, High=2, Low=3, Close=4, Volume=5, P=6",1,6,4); display:=Input("display -100~100%=1, -90~90 degrees=2",1,2,1); hist:=Input("display positive histogram fill (on=1, off=0)",0,1,1); plot:=Input("[1] LinReg Slope, [2] signals", 1,2,1); x:=If(x=1,O,If(x=2,H,If(x=3,L, If(x=5,V,If(x=6,P,C))))); LRlast:=LinearReg(x,pds); LRS:=LinRegSlope(x,pds); LRprev:=LRlast-LRS; {LRstart:=Ref(LRlast-LRS*(pds-1),pds-1);} a:=Min(LRlast,LRprev)/Max(LRlast,LRprev); LRratio:=(If(LRlast>LRprev,2-a,a)-1)*80; LRSdeg:=If(LRratio<0,Atan(LRratio,1)-360, Atan(LRratio,1)); LRSper:=LRSdeg*10/9; LRStrue:=If(display=2,LRSdeg,LRSper); signal:=Mov(LRStrue,pds1,E); BuySell:= Cross(LRStrue,signal)-Cross(signal,LRStrue); odd:=Cum(1)/2=Int(Cum(1)/2); odd:=If(hist=1 AND LRStrue>signal, If(odd,signal,LRStrue),LRStrue); If(plot=1,odd,0); If(plot=1,signal,0); If(plot=1,LRStrue,BuySell) ---8<--------------------------- http://www.metastocktools.com and MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula below. ============= EMA - slope % ============= ---8<--------------------------- { EMA slope % v2.0, +/- 0~100% } { ©Copyright 2003 Jose Silva } { http://www.metastocktools.com } pds:=Input("EMA periods",2,2520,21); x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4); x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C))))); EMA:=Mov(x,pds,E); EMAprev:=Ref(EMA,-1); y:=Min(EMA,EMAprev)/Max(EMA,EMAprev); EMAratio:=(If(EMA>EMAprev,2-y,y)-1)*100; EMAper:=If(EMAratio<0,Atan(EMAratio,1)-360, Atan(EMAratio,1))*10/9; signal:=Mov(EMAper,pds,E); 0;signal;EMAper ---8<--------------------------- http://www.metastocktools.com
Jose  
#2 Posted : Monday, August 22, 2005 6:55:42 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
CN[censored], this is the same problem that plagues Elliot Wave & Fib followers. When you really think about it, it is not possible to derive an absolute value for the slope of any indicator or price on a chart. Any pseudo slope, such as the AmiBroker & MetaStock code sample plots, cannot provide absolute slope values. An absolute slope requires two absolute values: x (horizontal, time) and y (vertical, price) axis. The vertical component of a plot can be absolute (price, indicator/oscillator values), but the horizontal axis is not - it shifts from chart to chart, from user to user. Since the reference x-axis (date bar) is neither constant nor absolute, the slope of an indicator being relative to the x-axis, slope values will depend on how far one stretches the total number of bars viewed on a chart. In other words, an EMA will look much steeper on a compressed chart (say, 260 bars from left to right edges), than it would on a more diluted chart (say, a 60 bar chart). In any case, the MetaStock sample code below provides a constant pseudo-slope in degrees. Perhaps this can be of use. [code:1:fb4f8b49c6] =================== EMA - slope degrees =================== ---8<--------------------------- { EMA slope deg v2.1, +/- 0~90deg } { ©Copyright 2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } pds:=Input("EMA periods",2,2600,34); x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5",1,5,4); x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,C)))); EMA:=Mov(x,pds,E); EMAprev:=Ref(EMA,-1); y:=Min(EMA,EMAprev)/Max(EMA,EMAprev); EMAratio:=(If(EMA>EMAprev,2-y,y)-1)*100; EMAdeg:=If(EMAratio<0,Atan(EMAratio,1)-360, Atan(EMAratio,1)){*10/9}; {<-remove brackets for 0~100% values} signal:=Mov(EMAdeg,pds,E); 0;signal;EMAdeg ---8<--------------------------- [/code:1:fb4f8b49c6] jose '-) http://www.metastocktools.com .
CN001532  
#3 Posted : Monday, August 22, 2005 11:20:18 AM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

Jose, Thank You I understand your point. However when using your formula to caclulate the pseudo-slope for # of degrees, it differs greatly from the identical amibroker and e-sginal calculated pseudo slope. For example, using the daily data from the Ami Broker, I calculate the pseudo slope of the 34 EMA of the daily Sept 05 Euro prices using Amibroker to be -33 degrees on 8/19/05. (also matched in e-sginal - but I do not have the code for this). Using your code the pseudo slope is a negative 4.72665 degrees. I'm curious, doesn't the following lines of of code from Amibroker normalize the distance required on the x axis required to calculate a pseudo slope? c_EMA34 = sqrt((x2_EMA34 - x1_EMA34)*(x2_EMA34 - x1_EMA34) + (y2_EMA34 - y1_EMA34)*(y2_EMA34 - y1_EMA34)); angle_EMA34 = round(180 * acos((x2_EMA34 - x1_EMA34)/c_EMA34) / PI); Regards, Joe
CN001532  
#4 Posted : Monday, August 22, 2005 12:48:14 PM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

Jose What about using arctan of the last two points of the moving average. For instance, if the price change is able to pull the 34EMA up by 1 full tick in 1 bar's time that equates to 45 deg. In Tradestation this can be done also be done using the 'LinearRegAngle' function. The catch is that you have to scale your price change so that 1 tick = '1'. So on the MiniDow it works as is. On the MiniRussel you have to multiply by 10, S&P e-mini by 4 etc. In TS you can get the multiplier automatically with : multiplier = 1 / (minmove/pricescale); So the angle is: Arctan(change in MA * Multiplier)
CN001532  
#5 Posted : Monday, August 22, 2005 2:22:39 PM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

Here is how the math is handled in esignal if this gives anyone some ideas that would be great slopelsma = (lsma - Prevlsma) * TicMult/TicDiv; anglelsma = Math.atan(slopelsma * EMA34AngleFactor) / PiDiv180; slopelsma = (lsma - (Prevlsma+Prevlsma1)/2) * TicMult/TicDiv; anglelsma2a = Math.atan(slopelsma * EMA34AngleFactor) / PiDiv180;
Jose  
#6 Posted : Monday, August 22, 2005 3:14:37 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
CN001532 wrote:
I calculate the pseudo slope of the 34 EMA of the daily Sept 05 Euro prices using Amibroker to be -33 degrees on 8/19/05. (also matched in e-sginal - but I do not have the code for this). Using your code the pseudo slope is a negative 4.72665 degrees.
Ok, looking at the EMA on that chart, which one looks right to you, the -33 deg or -5 deg plot? I know which one I would choose. ;) The point here is that there can be no absolute way to measure slope. Some methods will calculate 1 tick up to be +45deg (extreme to say the least!), whilst others may show a much lower values for the same price move. All slope-measuring methods should return values bounded at -90~+90 degrees, although the extremes (-90/+90deg) are theoretically impossible. jose '-) http://metastocktools.com .
CN001532  
#7 Posted : Monday, August 22, 2005 4:06:57 PM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

Jose, I completely agree with your point, and I don't need a degree calcuation for my needs as the slope is sufficient for me. However, what I really need to do is to reconcile the degree calculation nomenclature where Amibroker and e-signal and tradestation (which agree with each other) so I can create a more universal template other than for my use. I guess my question really boils down to: Can the provided amibroker code be converted to a metatstock indicator? This CCI trading template that I'm attempting to replicate is the most popular download that esignal has, by far. But in order "to speak the same language" as 2,000+ users on the www.woodiescciclub.com website. I need to get over this hurdle. Currently only 2 or 3 users in this group use Metastock, which is most disappointing. There is tradestation code and amibroker code that is freely available that has the degree calculation - however imperfect the function is. An integral part of the template is calculating the number of degrees - for the 34ema and 25 lsma - however rightly or wrongly its labeled. In fact I just use the slope calcuation within Metastock, not the angle calcuation to produce identical reults, so what I'm really trying to solve is a nomenclature issue not really a new or a fundamental change in calculating the slope (as expressed in degrees) Regardless I'm going to need to match the output at least temporarily in order to make progress. Can this be done? Your code is fine for my purposes, but it would be nice to get support from Metastock as there is a marketing opportunity here that is being missed to this community. Can you help me any further along these lines.
Jose  
#8 Posted : Tuesday, August 23, 2005 5:10:38 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Joe, I don't have MetaStock with me on holidays, but although the AB code above seems incomplete to me, it shouldn't be too difficult to convert it to MFL. Try something like this initial conversion try - you'll need to debug the MS code: [code:1:9a14117256]============= AB -> MS code ============= ---8<------------------------------ pds:=Input("EMA periods",1,2600,34); EMA34:=Mov(C,pds,E); {LSMA25:=?} PI:=3.141593; periods:=30; HighHigh:=HHV(H,periods); LowLow:=LLV(L,periods); range:=25/(HighHigh-LowLow)*LowLow; x1_EMA34:=0; x2_EMA34:=2; y1_EMA34:=0; y2_EMA34:=(Ref(EMA34,-2)-EMA34)/Avg{?}*range; c_EMA34:=sqrt((x2_EMA34 - x1_EMA34)*(x2_EMA34 - x1_EMA34) +(y2_EMA34 - y1_EMA34)*(y2_EMA34 - y1_EMA34)); angle_EMA34:=Int(180*acos{?}((x2_EMA34 - x1_EMA34)/c_EMA34) / PI); x1_LSMA25:=0; x2_LSMA25:=2; y1_LSMA25:=0; y2_LSMA25:=(Ref(LSMA25,-2)-LSMA25)/Avg{?}*range; c_LSMA25:= sqrt((x2_LSMA25 - x1_LSMA25)*(x2_LSMA25 - x1_LSMA25) + (y2_LSMA25 - y1_LSMA25)*(y2_LSMA25 - y1_LSMA25)); angle_LSMA25:=Int(180*acos{?}((x2_LSMA25-x1_LSMA25)/c_LSMA25)/PI); angle_EMA34; angle_LSMA25 ---8<------------------------------[/code:1:9a14117256] jose '-) http://metastocktools.com .
Nag  
#9 Posted : Tuesday, August 23, 2005 7:43:10 AM(UTC)
Nag

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/2/2005(UTC)
Posts: 7
Location: Aix-en-Provence - France

A quick look at AmiBroker documentation and you would have found that Avg is a data array of the 'typical price' ((H + L + C) / 3). Hope this helps... :wink:
CN001532  
#10 Posted : Tuesday, August 23, 2005 10:19:58 AM(UTC)
CN001532

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/22/2005(UTC)
Posts: 30

Thank you nag. thank you Jose, I originally posted my best attempt at converting the relevant Amibroker to Metastock code conversion to the other thread with this name yesterday. It seems that the only values I get are +57 and -57 for any data series. Jose the following temporary variables are illegal in Metastock X1_EMA34 etc. => so I shortened it to X1, X2, etc. Also C is reserved in metastock so this is an illegal temp variable so I made this C1 I hardcoded the # of periods to 34 for the 34 EMA and left out the periods variable statement. I also left out the reference to the 25LSMA to concentrate just on this 34EMA degrees issue. acos in AB is cos in Metastock ---------8<------------------------------------------------------ EMA34:= Mov(C,34,E); PI:= 3.141593; HighHigh:= HHV(H, 30); LowLow:= LLV(L, 30); range:= 25/(HighHigh - LowLow)*LowLow; x1:= 0; x2:= 2; y1:= 0; y2:= (Ref(EMA34, -2) - EMA34) / ATR(25)*range; c1:= Sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); angle:= Round(180 * Cos((x2 - x1)/c1) / PI); If(y2 > 0, -angle, angle); ---------8<------------------------------------------------------ Below is the entire AmiBroker code - opensource- that is used to create a trading panel - I thought I included all the relevant parts for the 34EMA degree calculation - maybe not. In any case I'm attaching a jpeg of the output and a lot of the coding refers to formatting. /////////////////////////////// // CCI Woodies Style - Started by Wring // Added and Modified by Kris (crasher_FL) // Version: 1.015 // Last Update: 08/01/2005 // Additions: // timer, EMA angle, LSMA angle, trending indicator // Amibroker 4.70 /////////////////////////////// Version(4.70); z = CCI(14); z6 = CCI(6); CCI50_var = CCI(50); LSMA25 = LinearReg(C, 25 ); EMA34 = EMA(C,34); EMAVOL3 = EMA(Volume, 3); PI = atan(1.00) * 4; periods = 30; HighHigh = HHV(H, periods); LowLow = LLV(L, periods); range = 25 / (HighHigh - LowLow) * LowLow; if(SelectedValue(CCI50_var) < 0) { CCI50Title = EncodeColor(colorRed); } else { CCI50Title = EncodeColor(colorLime); } CCI50Title = CCI50Title + "CCI 50 = " + round(CCI50_var) + ", "; StopTitle = EncodeColor(colorWhite) + "STOP = " + EncodeColor(colorYellow); StopTitle = StopTitle + IIf(O < C, IIf((H - O) < (C - L), StrToNum(NumToStr(C - L, 4.4)), StrToNum(NumToStr(H - O, 4.4))), IIf((O - L) < (H - C), StrToNum(NumToStr(H - C, 4.4)), StrToNum(NumToStr(O - L, 4.4)))); x1_EMA34 = 0; x2_EMA34 = 2; y1_EMA34 = 0; y2_EMA34 = (Ref(EMA34, -2) - EMA34) / Avg * range; c_EMA34 = sqrt((x2_EMA34 - x1_EMA34)*(x2_EMA34 - x1_EMA34) + (y2_EMA34 - y1_EMA34)*(y2_EMA34 - y1_EMA34)); angle_EMA34 = round(180 * acos((x2_EMA34 - x1_EMA34)/c_EMA34) / PI); TitleAngleEMA34 = EncodeColor(colorWhite) + "\\nEMA34 angle = "; angle_EMA34 = IIf(y2_EMA34 > 0, - angle_EMA34, angle_EMA34); if(abs(SelectedValue(angle_EMA34)) >= 25) { TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorLime); } else if(abs(SelectedValue(angle_EMA34)) >= 15) { TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorYellow); } else { TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorRed); } TitleAngleEMA34 = TitleAngleEMA34 + angle_EMA34; x1_LSMA25 = 0; x2_LSMA25 = 2; y1_LSMA25 = 0; y2_LSMA25 = (Ref(LSMA25, -2) - LSMA25) / Avg * range; c_LSMA25 = sqrt((x2_LSMA25 - x1_LSMA25)*(x2_LSMA25 - x1_LSMA25) + (y2_LSMA25 - y1_LSMA25)*(y2_LSMA25 - y1_LSMA25)); angle_LSMA25 = round(180 * acos((x2_LSMA25 - x1_LSMA25)/c_LSMA25) / PI); TitleAngleLSMA25 = EncodeColor(colorWhite) + "LSMA25 angle = "; angle_LSMA25 = IIf(y2_LSMA25 > 0, - angle_LSMA25, angle_LSMA25); if(abs(SelectedValue(angle_LSMA25)) >= 25) { TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorLime); } else if(abs(SelectedValue(angle_LSMA25)) >= 15) { TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorYellow); } else { TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorRed); } TitleAngleLSMA25 = TitleAngleLSMA25 + angle_LSMA25; TitleTrending = WriteIf((abs(angle_EMA34) >= 15) AND (abs(angle_EMA34 + angle_LSMA25) >= 50), EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorLime) + "TRENDING", WriteIf((abs(angle_EMA34) >= 5) AND (((angle_EMA34 >= 0) AND (angle_LSMA25 >= 0)) OR ((angle_EMA34 <= 0) AND (angle_LSMA25 <= 0))) AND (abs(angle_EMA34 + angle_LSMA25) >= 30), EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorYellow) + "NORMAL", EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorRed) + "FLAT")); SW = IIf((abs(angle_EMA34) >= 15) AND (abs(angle_EMA34 + angle_LSMA25) >= 50), IIf(angle_LSMA25 > 0, 2, -2), IIf((abs(angle_EMA34) >= 5) AND (((angle_EMA34 >= 0) AND (angle_LSMA25 >= 0)) OR ((angle_EMA34 <= 0) AND (angle_LSMA25 <= 0))) AND (abs(angle_EMA34 + angle_LSMA25) >= 30), IIf(angle_LSMA25 > 0, 1, -1), 0)); tempnum = Now( 4 ) - TimeNum(); TimeRem = Interval() - ((int(tempnum[BarCount - 1] / 100) * 60) + (tempnum[BarCount - 1] - int(tempnum[BarCount - 1] / 100) * 100)); if (TimeRem[BarCount - 1] < 0) TimeRem = 0; TitleTimeRem = EncodeColor(colorBlueGrey) + "Time Remaining: "; MinuteVar = int(TimeRem / 60); SecondsVar = int(frac(TimeRem / 60) * 60); if (TimeRem[BarCount - 1] > 60) { TitleTimeRem = TitleTimeRem + EncodeColor(colorWhite) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; } else if (TimeRem[BarCount - 1] > 20) { TitleTimeRem = TitleTimeRem + EncodeColor(colorYellow) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; } else { TitleTimeRem = TitleTimeRem + EncodeColor(colorLime) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; } Title = "" + Name() + ", " + Interval(2) + ", " + Date() + "\\n" + EncodeColor(colorSkyblue) + "CCI 14 = " + round(z) + EncodeColor(colorWhite) + ", " + EncodeColor(colorLightOrange) + "CCI 6 = " + round(z6) + EncodeColor(colorWhite) + ", " + //CCI50Title + StopTitle + // "\\nC = " + C + ", H = " + H + ", L = " + L + ", O = " + O + TitleAngleEMA34 + EncodeColor(colorWhite) + ", " + TitleAngleLSMA25 + TitleTrending + EncodeColor(colorWhite) + "\\nVolume = " + EncodeColor(colorYellow) + Volume + EncodeColor(colorWhite) + ", " + TitleTimeRem; // Colour the bars for Woodies Trend Following Plusbars = BarsSince(z < 0); Minusbars = BarsSince(z > 0); TrendBarCount = 6; Color[0] = colorDefault; Trend[0] = 0; for( i = 1; i < BarCount; i++ ) { if (Plusbars >= TrendBarCount) { Trend = 1; } else if (Minusbars >= TrendBarCount) { Trend = -1; } else { Trend = Trend[i - 1]; } if (Trend == 1) { if (Minusbars == TrendBarCount - 1) { Color = colorGold; } else if (z < 0) { Color = colorDarkBlue; } else { Color = colorGreen; } } else if (Trend == -1) { if (Plusbars == TrendBarCount - 1) { Color = colorGold; } else if (z >= 0) { Color = colorDarkBlue; } else { Color = colorRed; } } else { Color = colorDefault; } } // CCI Line Plot(z,"CCI 14", colorSkyblue, styleLine | styleThick); // Turbo CCI Plot(z6,"CCI 6", colorLightOrange, styleLine | styleNoLabel); // CCI Histogram Plot(z,"",Color,styleHistogram | styleNoLabel); // CCI 50 //Plot(CCI50_var,"CCI 50", IIf(CCI50_var < 0, colorDarkRed,colorDarkGreen), styleLine | styleNoLabel); // zero line 25lsma Plot(0,"",IIf(C > LSMA25,colorGreen,IIf(C<LSMA25,colorRed,colorTeal)), styleThick | styleNoLabel); // Set up color for the 100s, green if 34ema above red if below Color = IIf(C > EMA34, colorGreen, IIf(C == EMA34, colorTeal, colorRed)); // Plot the 100s Plot(100,"",Color,styleDots |styleNoLine | styleNoLabel | styleThick); Plot(-100,"",Color,styleDots |styleNoLine | styleNoLabel | styleThick); // Set up color for the 200s, green if 34ema above red if below ColorVol = IIf(EMAVOL3 > 400, colorLime, IIf(EMAVOL3 > 300, colorGreen, IIf(EMAVOL3 > 200, colorDarkGreen, colorRed))); // Plot the 200s Plot(200,"", ColorVol, styleDots | styleNoLine | styleNoLabel | styleThick); Plot(-200,"", ColorVol, styleDots | styleNoLine | styleNoLabel | styleThick); // Plot the 50s PlotGrid(50,colorTeal); PlotGrid(-50, colorTeal); // Plot the 200s PlotGrid(200, styleNoLine); PlotGrid(-200, styleNoLine);
Users browsing this topic
Guest (Hidden)
Similar Topics
Caculating the actual degrees in the EMA (Formula Assistance)
by CN001532 8/22/2005 3:46:53 AM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.