Metatrader Expert Advisor

Indicatore MetaTrader //+------------------------------------------------------------------+ //| HMA.mq4 //| Copyright © 2006 WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak051a662ad48e28de32634e6189577226').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy051a662ad48e28de32634e6189577226 = 'wizardserg' + '@'; addy051a662ad48e28de32634e6189577226 = addy051a662ad48e28de32634e6189577226 + 'mail' + '.' + 'ru'; var addy_text051a662ad48e28de32634e6189577226 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak051a662ad48e28de32634e6189577226').innerHTML += ''+addy_text051a662ad48e28de32634e6189577226+''; >, ?? ??????? ForexMagazine #104 //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakeb88afe3dd80083a0095f82e563ffa23').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyeb88afe3dd80083a0095f82e563ffa23 = 'wizardserg' + '@'; addyeb88afe3dd80083a0095f82e563ffa23 = addyeb88afe3dd80083a0095f82e563ffa23 + 'mail' + '.' + 'ru'; var addy_texteb88afe3dd80083a0095f82e563ffa23 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakeb88afe3dd80083a0095f82e563ffa23').innerHTML += ''+addy_texteb88afe3dd80083a0095f82e563ffa23+''; //| Revised by IgorAD,Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak5519657dc979a39a7f0ffcfdd12f0fd6').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy5519657dc979a39a7f0ffcfdd12f0fd6 = 'igorad2003' + '@'; addy5519657dc979a39a7f0ffcfdd12f0fd6 = addy5519657dc979a39a7f0ffcfdd12f0fd6 + 'yahoo' + '.' + 'co' + '.' + 'uk'; var addy_text5519657dc979a39a7f0ffcfdd12f0fd6 = 'igorad2003' + '@' + 'yahoo' + '.' + 'co' + '.' + 'uk';document.getElementById('cloak5519657dc979a39a7f0ffcfdd12f0fd6').innerHTML += ''+addy_text5519657dc979a39a7f0ffcfdd12f0fd6+''; | //| Personalized by iGoR AKA FXiGoR for the Trend Slope Trading method (T_S_T) //| Link: //| contact: Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak30862debaf93bfcc971cd436fa69d2cd').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy30862debaf93bfcc971cd436fa69d2cd = 'thefuturemaster' + '@'; addy30862debaf93bfcc971cd436fa69d2cd = addy30862debaf93bfcc971cd436fa69d2cd + 'hotmail' + '.' + 'com'; var addy_text30862debaf93bfcc971cd436fa69d2cd = 'thefuturemaster' + '@' + 'hotmail' + '.' + 'com';document.getElementById('cloak30862debaf93bfcc971cd436fa69d2cd').innerHTML += ''+addy_text30862debaf93bfcc971cd436fa69d2cd+''; //+------------------------------------------------------------------+ #property copyright "MT4 release WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak9732e808b2c1a9b9cdb5dc6e1b5dcb7a').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy9732e808b2c1a9b9cdb5dc6e1b5dcb7a = 'wizardserg' + '@'; addy9732e808b2c1a9b9cdb5dc6e1b5dcb7a = addy9732e808b2c1a9b9cdb5dc6e1b5dcb7a + 'mail' + '.' + 'ru'; var addy_text9732e808b2c1a9b9cdb5dc6e1b5dcb7a = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak9732e808b2c1a9b9cdb5dc6e1b5dcb7a').innerHTML += ''+addy_text9732e808b2c1a9b9cdb5dc6e1b5dcb7a+''; >, ?? ??????? ForexMagazine #104" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakbdf5fd7384b25c267053590225c6c341').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addybdf5fd7384b25c267053590225c6c341 = 'wizardserg' + '@'; addybdf5fd7384b25c267053590225c6c341 = addybdf5fd7384b25c267053590225c6c341 + 'mail' + '.' + 'ru'; var addy_textbdf5fd7384b25c267053590225c6c341 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakbdf5fd7384b25c267053590225c6c341').innerHTML += ''+addy_textbdf5fd7384b25c267053590225c6c341+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 LightBlue #property indicator_color2 Tomato //---- input parameters extern int period=80; extern int method=3; // MODE_SMA extern int price=0; // PRICE_CLOSE //---- buffers double Uptrend[]; double Dntrend[]; double ExtMapBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(3); SetIndexBuffer(0, Uptrend); //ArraySetAsSeries(Uptrend, true); SetIndexBuffer(1, Dntrend); //ArraySetAsSeries(Dntrend, true); SetIndexBuffer(2, ExtMapBuffer); ArraySetAsSeries(ExtMapBuffer, true); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2); IndicatorShortName("Slope Direction Line("+period+")"); return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { // ???? ????? ?????? ?????? return(0); } //+------------------------------------------------------------------+ //| ?????????? ??????? | //+------------------------------------------------------------------+ double WMA(int x, int p) { return(iMA(NULL, 0, p, 0, method, price, x)); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); int x = 0; int p = MathSqrt(period); int e = Bars - counted_bars + period + 1; double vect[], trend[]; if(e > Bars) e = Bars; ArrayResize(vect, e); ArraySetAsSeries(vect, true); ArrayResize(trend, e); ArraySetAsSeries(trend, true); for(x = 0; x < e; x++) { vect[x] = 2*WMA(x, period/2) - WMA(x, period); // Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period)); } for(x = 0; x < e-period; x++) ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x); for(x = e-period; x >= 0; x--) { trend[x] = trend[x+1]; if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1; if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1; if (trend[x]>0) { Uptrend[x] = ExtMapBuffer[x]; if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1]; Dntrend[x] = EMPTY_VALUE; } else if (trend[x]<0) { Dntrend[x] = ExtMapBuffer[x]; if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1]; Uptrend[x] = EMPTY_VALUE; } //Print( " trend=",trend[x]); } return(0); } //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| HMA.mq4 //| Copyright © 2006 WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakb7088f055b6fb343b02bca3ddaa653e3').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyb7088f055b6fb343b02bca3ddaa653e3 = 'wizardserg' + '@'; addyb7088f055b6fb343b02bca3ddaa653e3 = addyb7088f055b6fb343b02bca3ddaa653e3 + 'mail' + '.' + 'ru'; var addy_textb7088f055b6fb343b02bca3ddaa653e3 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakb7088f055b6fb343b02bca3ddaa653e3').innerHTML += ''+addy_textb7088f055b6fb343b02bca3ddaa653e3+''; >, ?? ??????? ForexMagazine #104 //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloaka792dc0faec0642902c30a055bd86f90').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addya792dc0faec0642902c30a055bd86f90 = 'wizardserg' + '@'; addya792dc0faec0642902c30a055bd86f90 = addya792dc0faec0642902c30a055bd86f90 + 'mail' + '.' + 'ru'; var addy_texta792dc0faec0642902c30a055bd86f90 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloaka792dc0faec0642902c30a055bd86f90').innerHTML += ''+addy_texta792dc0faec0642902c30a055bd86f90+''; //| Revised by IgorAD,Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakf2ceb2e7acde0f39e877dde33bb67ecc').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyf2ceb2e7acde0f39e877dde33bb67ecc = 'igorad2003' + '@'; addyf2ceb2e7acde0f39e877dde33bb67ecc = addyf2ceb2e7acde0f39e877dde33bb67ecc + 'yahoo' + '.' + 'co' + '.' + 'uk'; var addy_textf2ceb2e7acde0f39e877dde33bb67ecc = 'igorad2003' + '@' + 'yahoo' + '.' + 'co' + '.' + 'uk';document.getElementById('cloakf2ceb2e7acde0f39e877dde33bb67ecc').innerHTML += ''+addy_textf2ceb2e7acde0f39e877dde33bb67ecc+''; | //| Personalized by iGoR AKA FXiGoR for the Trend Slope Trading method (T_S_T) //| Link: //| contact: Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakac351d77aeea0785670486815ac59bb9').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyac351d77aeea0785670486815ac59bb9 = 'thefuturemaster' + '@'; addyac351d77aeea0785670486815ac59bb9 = addyac351d77aeea0785670486815ac59bb9 + 'hotmail' + '.' + 'com'; var addy_textac351d77aeea0785670486815ac59bb9 = 'thefuturemaster' + '@' + 'hotmail' + '.' + 'com';document.getElementById('cloakac351d77aeea0785670486815ac59bb9').innerHTML += ''+addy_textac351d77aeea0785670486815ac59bb9+''; //+------------------------------------------------------------------+ #property copyright "MT4 release WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak5e640e4aaf5a9af19aa7b0ba7914ee5d').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy5e640e4aaf5a9af19aa7b0ba7914ee5d = 'wizardserg' + '@'; addy5e640e4aaf5a9af19aa7b0ba7914ee5d = addy5e640e4aaf5a9af19aa7b0ba7914ee5d + 'mail' + '.' + 'ru'; var addy_text5e640e4aaf5a9af19aa7b0ba7914ee5d = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak5e640e4aaf5a9af19aa7b0ba7914ee5d').innerHTML += ''+addy_text5e640e4aaf5a9af19aa7b0ba7914ee5d+''; >, ?? ??????? ForexMagazine #104" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak89853e83d0861cc2118e8edff7a60cee').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy89853e83d0861cc2118e8edff7a60cee = 'wizardserg' + '@'; addy89853e83d0861cc2118e8edff7a60cee = addy89853e83d0861cc2118e8edff7a60cee + 'mail' + '.' + 'ru'; var addy_text89853e83d0861cc2118e8edff7a60cee = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak89853e83d0861cc2118e8edff7a60cee').innerHTML += ''+addy_text89853e83d0861cc2118e8edff7a60cee+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red //---- input parameters extern int period=15; extern int method=3; // MODE_SMA extern int price=0; // PRICE_CLOSE //---- buffers double Uptrend[]; double Dntrend[]; double ExtMapBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(3); SetIndexBuffer(0, Uptrend); //ArraySetAsSeries(Uptrend, true); SetIndexBuffer(1, Dntrend); //ArraySetAsSeries(Dntrend, true); SetIndexBuffer(2, ExtMapBuffer); ArraySetAsSeries(ExtMapBuffer, true); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2); IndicatorShortName("Signal Line("+period+")"); return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { // ???? ????? ?????? ?????? return(0); } //+------------------------------------------------------------------+ //| ?????????? ??????? | //+------------------------------------------------------------------+ double WMA(int x, int p) { return(iMA(NULL, 0, p, 0, method, price, x)); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); int x = 0; int p = MathSqrt(period); int e = Bars - counted_bars + period + 1; double vect[], trend[]; if(e > Bars) e = Bars; ArrayResize(vect, e); ArraySetAsSeries(vect, true); ArrayResize(trend, e); ArraySetAsSeries(trend, true); for(x = 0; x < e; x++) { vect[x] = 2*WMA(x, period/2) - WMA(x, period); // Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period)); } for(x = 0; x < e-period; x++) ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x); for(x = e-period; x >= 0; x--) { trend[x] = trend[x+1]; if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1; if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1; if (trend[x]>0) { Uptrend[x] = ExtMapBuffer[x]; if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1]; Dntrend[x] = EMPTY_VALUE; } else if (trend[x]<0) { Dntrend[x] = ExtMapBuffer[x]; if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1]; Uptrend[x] = EMPTY_VALUE; } //Print( " trend=",trend[x]); } return(0); } //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| (T_S_R)-Daily Range Calculator v1.3.mq4 | //| Copyright © 2006, Ogeima | //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakf501656fa897def0fa71b50fea1eb15e').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyf501656fa897def0fa71b50fea1eb15e = 'ph_bresson' + '@'; addyf501656fa897def0fa71b50fea1eb15e = addyf501656fa897def0fa71b50fea1eb15e + 'yahoo' + '.' + 'com'; var addy_textf501656fa897def0fa71b50fea1eb15e = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakf501656fa897def0fa71b50fea1eb15e').innerHTML += ''+addy_textf501656fa897def0fa71b50fea1eb15e+''; //|Made for the TSR (Trend Slope Retracement) system by FXiGoR | //|http://strategybuilderfx.com/showthread.php?t=17252 | //+------------------------------------------------------------------+ // For basic explanations, see the notes at the end this script. // For information regarding the T_S_R method, read the "FXiGoR-(T_S_R) very effective Trend Slope Retracement system" thread opened by iGoR at StrategyBuilderfx, Forex-tsd, MoneyTec, ForexFactory or Trade2Win. #property copyright "Copyright © 2006, Ogeima" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakb47c25d11b6fc84939cde13293ab7990').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyb47c25d11b6fc84939cde13293ab7990 = 'ph_bresson' + '@'; addyb47c25d11b6fc84939cde13293ab7990 = addyb47c25d11b6fc84939cde13293ab7990 + 'yahoo' + '.' + 'com'; var addy_textb47c25d11b6fc84939cde13293ab7990 = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakb47c25d11b6fc84939cde13293ab7990').innerHTML += ''+addy_textb47c25d11b6fc84939cde13293ab7990+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Green #property indicator_color2 Red //---- input parameters extern double Risk_to_Reward_ratio = 3.0; double aSL_Long[]; double aSL_Short[]; int nDigits; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(2); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3); SetIndexBuffer(0,aSL_Long); SetIndexBuffer(1,aSL_Short); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexEmptyValue(1,EMPTY_VALUE); if(Symbol()=="GBPJPY" || Symbol()=="EURJPY" || Symbol()=="USDJPY" || Symbol()=="CHFJPY" || Symbol()=="GOLD" || Symbol()=="_SP500") nDigits = 2; else nDigits = 4; return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { Comment(""); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int R1=0,R5=0,R10=0,R20=0,RAvg=0; int RoomUp=0,RoomDown=0,StopLoss_Long=0,StopLoss_Short=0; double SL_Long=0,SL_Short=0; double low0=0,high0=0; string Text=""; int i=0; R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point; for(i=1;i<=5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; R5 = R5/5; R10 = R10/10; R20 = R20/20; RAvg = (R5+R10+R20)/3; low0 = iLow(NULL,PERIOD_D1,0); high0 = iHigh(NULL,PERIOD_D1,0); RoomUp = RAvg - (Bid - low0)/Point; RoomDown = RAvg - (high0 - Bid)/Point; StopLoss_Long = RoomUp/Risk_to_Reward_ratio; SL_Long = Bid - StopLoss_Long*Point; StopLoss_Short = RoomDown/Risk_to_Reward_ratio; SL_Short = Bid + StopLoss_Short*Point; Text = "Average Day Range: " + RAvg + "\n" + "Prev 01 Day Range: " + R1 + "\n" + "Prev 05 Days Range: " + R5 + "\n" + "Prev 10 Days Range: " + R10 + "\n" + "Prev 20 Days Range: " + R20 + "\n"; Text = Text + "Room Up: " + RoomUp + "\n" + "Room Down: " + RoomDown + "\n" + "Max. StopLosses should be :" + "\n" + "Long: " + StopLoss_Long + " Pips at " + DoubleToStr(SL_Long,nDigits) + "\n" + "Short: " + StopLoss_Short + " Pips at " + DoubleToStr(SL_Short,nDigits) + "\n"; Comment(Text); //-- SL Lines int limit; int counted_bars=IndicatorCounted(); if(counted_bars<0) counted_bars=0; if(counted_bars>0) counted_bars--; limit = counted_bars; for(i = 0 ;i <= limit ;i++) { if(i==0 || i==1 || i==2) { aSL_Long[i] = SL_Long; aSL_Short[i]= SL_Short; } else { aSL_Long[i] = EMPTY_VALUE; aSL_Short[i]= EMPTY_VALUE; } } return(0); } //+------------------------------------------------------------------+ /* Here's a little "indicator" that does some basic calculations for us. Let's look at what it does: It computes yesterday's range, the previous 5, 10 and 20 days ranges. And it calculates the "Average Day Range" of these four ranges (yesterday's+ Prev 5 Day Range + Prev 10 Day Range + Prev 20 Day Range)/4. So, if yesterday's Day Range was 80, the Previous 5 Day Range was 110, the Previous 10 Day Range was 90 and the Previous 20 Day Range was 120, then the Average Day Range would be 100. Then there's "Room Up" and "Room Down". Let's imagine today's low is (so far) 1000 and today's high is (so far) 1050. At this moment the price is 1020. So we're 1020-1000= 20 pips above the low, there is therefore 100-20=80 pips "left" up. For a risk-to-reward ratio of (say) 3, if a long trade was to be entered now, the stop loss should be no more than 80/3=26pips away, that is at 1020-26=994. So, if all conditions are met, we ll look for a "bottom" no lower than 994. Same thing for a short trade: we are 1050-1020= 30 pips below the high, there is therefore 100-30=70 pips "left" down. For a risk-to-reward ratio of 3, if a short trade was to be entered now, the stop loss should be no more than 70/3=23pips away, that is at 1020+23=1043. So, if all conditions are met, we ll look for a "top" no higher than 1043. As you can see, this indicator doesn't tell us whether or not we have a set up to trade. What it does is, considering some past day ranges, and for a given Risk to Reward ratio, it tells us how far away we can put a stop loss. Hope this helps, Ogeima. P.S.: I used H-L (High-Low) to compute the Ranges. They are thus a bit different from mataf.net data, which computes what is known as the "True" Ranges (= Max(High for the period less the Low for the period,High for the period less the Close for the previous period,Close for the previous period and the Low for the current period)). -------- PS1: occasionnally, as someone apparently pointed out in the chatroom, RoomUp/RoomDown (and the indicative stop losses) will have negative values. For example, let's imagine that the Average Day Range is 100, today's High is 1150, today's low is 1000 and the current price is 1040. Price has traveled 1150-1040 = 110 pips down from the High, that's 10 pips more than the 100 pips of the Average Day Range, so the RoomDown will be -10 pips (and the stoploss will be -10/Risk_to_Reward_ratio). (And price has traveled 1040-1000= 40 pips from the Low so the RoomUp will be positive (=100-40=60), nothing special here.) -------- v1.3: added 2 horizontal lines at the level of the StopLosses: Green line for Long SL, Red line for Short SL. */ //+------------------------------------------------------------------+ //| (T_S_R)-Daily Range Calculator v1.3.mq4 | //| Copyright © 2006, Ogeima | //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak90505ad3fbaa98b9f45a5eacae2ce40a').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy90505ad3fbaa98b9f45a5eacae2ce40a = 'ph_bresson' + '@'; addy90505ad3fbaa98b9f45a5eacae2ce40a = addy90505ad3fbaa98b9f45a5eacae2ce40a + 'yahoo' + '.' + 'com'; var addy_text90505ad3fbaa98b9f45a5eacae2ce40a = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak90505ad3fbaa98b9f45a5eacae2ce40a').innerHTML += ''+addy_text90505ad3fbaa98b9f45a5eacae2ce40a+''; //|Made for the TSR (Trend Slope Retracement) system by FXiGoR | //|http://strategybuilderfx.com/showthread.php?t=17252 | //+------------------------------------------------------------------+ // For basic explanations, see the notes at the end this script. // For information regarding the T_S_R method, read the "FXiGoR-(T_S_R) very effective Trend Slope Retracement system" thread opened by iGoR at StrategyBuilderfx, Forex-tsd, MoneyTec, ForexFactory or Trade2Win. #property copyright "Copyright © 2006, Ogeima" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak1a2c980158280d10885db1fe8d4fecd8').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy1a2c980158280d10885db1fe8d4fecd8 = 'ph_bresson' + '@'; addy1a2c980158280d10885db1fe8d4fecd8 = addy1a2c980158280d10885db1fe8d4fecd8 + 'yahoo' + '.' + 'com'; var addy_text1a2c980158280d10885db1fe8d4fecd8 = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak1a2c980158280d10885db1fe8d4fecd8').innerHTML += ''+addy_text1a2c980158280d10885db1fe8d4fecd8+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Green #property indicator_color2 Red //---- input parameters extern double Risk_to_Reward_ratio = 3.0; double aSL_Long[]; double aSL_Short[]; int nDigits; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(2); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3); SetIndexBuffer(0,aSL_Long); SetIndexBuffer(1,aSL_Short); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexEmptyValue(1,EMPTY_VALUE); if(Symbol()=="GBPJPY" || Symbol()=="EURJPY" || Symbol()=="USDJPY" || Symbol()=="CHFJPY" || Symbol()=="GOLD" || Symbol()=="_SP500") nDigits = 2; else nDigits = 4; return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { Comment(""); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int R1=0,R5=0,R10=0,R20=0,RAvg=0; int RoomUp=0,RoomDown=0,StopLoss_Long=0,StopLoss_Short=0; double SL_Long=0,SL_Short=0; double low0=0,high0=0; string Text=""; int i=0; R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point; for(i=1;i<=5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; R5 = R5/5; R10 = R10/10; R20 = R20/20; RAvg = (R5+R10+R20)/3; low0 = iLow(NULL,PERIOD_D1,0); high0 = iHigh(NULL,PERIOD_D1,0); RoomUp = RAvg - (Bid - low0)/Point; RoomDown = RAvg - (high0 - Bid)/Point; StopLoss_Long = RoomUp/Risk_to_Reward_ratio; SL_Long = Bid - StopLoss_Long*Point; StopLoss_Short = RoomDown/Risk_to_Reward_ratio; SL_Short = Bid + StopLoss_Short*Point; Text = "Average Day Range: " + RAvg + "\n" + "Prev 01 Day Range: " + R1 + "\n" + "Prev 05 Days Range: " + R5 + "\n" + "Prev 10 Days Range: " + R10 + "\n" + "Prev 20 Days Range: " + R20 + "\n"; Text = Text + "Room Up: " + RoomUp + "\n" + "Room Down: " + RoomDown + "\n" + "Max. StopLosses should be :" + "\n" + "Long: " + StopLoss_Long + " Pips at " + DoubleToStr(SL_Long,nDigits) + "\n" + "Short: " + StopLoss_Short + " Pips at " + DoubleToStr(SL_Short,nDigits) + "\n"; Comment(Text); //-- SL Lines int limit; int counted_bars=IndicatorCounted(); if(counted_bars<0) counted_bars=0; if(counted_bars>0) counted_bars--; limit = counted_bars; for(i = 0 ;i <= limit ;i++) { if(i==0 || i==1 || i==2) { aSL_Long[i] = SL_Long; aSL_Short[i]= SL_Short; } else { aSL_Long[i] = EMPTY_VALUE; aSL_Short[i]= EMPTY_VALUE; } } return(0); } //+------------------------------------------------------------------+ /* Here's a little "indicator" that does some basic calculations for us. Let's look at what it does: It computes yesterday's range, the previous 5, 10 and 20 days ranges. And it calculates the "Average Day Range" of these four ranges (yesterday's+ Prev 5 Day Range + Prev 10 Day Range + Prev 20 Day Range)/4. So, if yesterday's Day Range was 80, the Previous 5 Day Range was 110, the Previous 10 Day Range was 90 and the Previous 20 Day Range was 120, then the Average Day Range would be 100. Then there's "Room Up" and "Room Down". Let's imagine today's low is (so far) 1000 and today's high is (so far) 1050. At this moment the price is 1020. So we're 1020-1000= 20 pips above the low, there is therefore 100-20=80 pips "left" up. For a risk-to-reward ratio of (say) 3, if a long trade was to be entered now, the stop loss should be no more than 80/3=26pips away, that is at 1020-26=994. So, if all conditions are met, we ll look for a "bottom" no lower than 994. Same thing for a short trade: we are 1050-1020= 30 pips below the high, there is therefore 100-30=70 pips "left" down. For a risk-to-reward ratio of 3, if a short trade was to be entered now, the stop loss should be no more than 70/3=23pips away, that is at 1020+23=1043. So, if all conditions are met, we ll look for a "top" no higher than 1043. As you can see, this indicator doesn't tell us whether or not we have a set up to trade. What it does is, considering some past day ranges, and for a given Risk to Reward ratio, it tells us how far away we can put a stop loss. Hope this helps, Ogeima. P.S.: I used H-L (High-Low) to compute the Ranges. They are thus a bit different from mataf.net data, which computes what is known as the "True" Ranges (= Max(High for the period less the Low for the period,High for the period less the Close for the previous period,Close for the previous period and the Low for the current period)). -------- PS1: occasionnally, as someone apparently pointed out in the chatroom, RoomUp/RoomDown (and the indicative stop losses) will have negative values. For example, let's imagine that the Average Day Range is 100, today's High is 1150, today's low is 1000 and the current price is 1040. Price has traveled 1150-1040 = 110 pips down from the High, that's 10 pips more than the 100 pips of the Average Day Range, so the RoomDown will be -10 pips (and the stoploss will be -10/Risk_to_Reward_ratio). (And price has traveled 1040-1000= 40 pips from the Low so the RoomUp will be positive (=100-40=60), nothing special here.) -------- v1.3: added 2 horizontal lines at the level of the StopLosses: Green line for Long SL, Red line for Short SL. */
Indicatore MetaTrader //+------------------------------------------------------------------+ //| HMA.mq4 //| Copyright © 2006 WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak9e48f49defd92f25bb856d5e2f9bccab').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy9e48f49defd92f25bb856d5e2f9bccab = 'wizardserg' + '@'; addy9e48f49defd92f25bb856d5e2f9bccab = addy9e48f49defd92f25bb856d5e2f9bccab + 'mail' + '.' + 'ru'; var addy_text9e48f49defd92f25bb856d5e2f9bccab = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak9e48f49defd92f25bb856d5e2f9bccab').innerHTML += ''+addy_text9e48f49defd92f25bb856d5e2f9bccab+''; >, ?? ??????? ForexMagazine #104 //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak2783f050ecbd38c7b67bf6bab3181423').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy2783f050ecbd38c7b67bf6bab3181423 = 'wizardserg' + '@'; addy2783f050ecbd38c7b67bf6bab3181423 = addy2783f050ecbd38c7b67bf6bab3181423 + 'mail' + '.' + 'ru'; var addy_text2783f050ecbd38c7b67bf6bab3181423 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak2783f050ecbd38c7b67bf6bab3181423').innerHTML += ''+addy_text2783f050ecbd38c7b67bf6bab3181423+''; //| Revised by IgorAD,Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak39210a530a99bd07125aa55e360ffae4').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy39210a530a99bd07125aa55e360ffae4 = 'igorad2003' + '@'; addy39210a530a99bd07125aa55e360ffae4 = addy39210a530a99bd07125aa55e360ffae4 + 'yahoo' + '.' + 'co' + '.' + 'uk'; var addy_text39210a530a99bd07125aa55e360ffae4 = 'igorad2003' + '@' + 'yahoo' + '.' + 'co' + '.' + 'uk';document.getElementById('cloak39210a530a99bd07125aa55e360ffae4').innerHTML += ''+addy_text39210a530a99bd07125aa55e360ffae4+''; | //| //| Personalized by iGoR AKA FXiGoR for the Trend Slope Trading method (T_S_T) //| Link: //| contact: Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak1d34c0c947f3c9a6c391a277b804c936').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy1d34c0c947f3c9a6c391a277b804c936 = 'thefuturemaster' + '@'; addy1d34c0c947f3c9a6c391a277b804c936 = addy1d34c0c947f3c9a6c391a277b804c936 + 'hotmail' + '.' + 'com'; var addy_text1d34c0c947f3c9a6c391a277b804c936 = 'thefuturemaster' + '@' + 'hotmail' + '.' + 'com';document.getElementById('cloak1d34c0c947f3c9a6c391a277b804c936').innerHTML += ''+addy_text1d34c0c947f3c9a6c391a277b804c936+''; //+------------------------------------------------------------------+ #property copyright "MT4 release WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak8e71d742c6a42042ec1508f4faa70ccf').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy8e71d742c6a42042ec1508f4faa70ccf = 'wizardserg' + '@'; addy8e71d742c6a42042ec1508f4faa70ccf = addy8e71d742c6a42042ec1508f4faa70ccf + 'mail' + '.' + 'ru'; var addy_text8e71d742c6a42042ec1508f4faa70ccf = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak8e71d742c6a42042ec1508f4faa70ccf').innerHTML += ''+addy_text8e71d742c6a42042ec1508f4faa70ccf+''; >, ?? ??????? ForexMagazine #104" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakfe80cab649da5583e2ed2db635e65d0c').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyfe80cab649da5583e2ed2db635e65d0c = 'wizardserg' + '@'; addyfe80cab649da5583e2ed2db635e65d0c = addyfe80cab649da5583e2ed2db635e65d0c + 'mail' + '.' + 'ru'; var addy_textfe80cab649da5583e2ed2db635e65d0c = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakfe80cab649da5583e2ed2db635e65d0c').innerHTML += ''+addy_textfe80cab649da5583e2ed2db635e65d0c+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Yellow #property indicator_color2 Magenta //---- input parameters extern int period=5; extern int method=3; // MODE_SMA extern int price=0; // PRICE_CLOSE //---- buffers double Uptrend[]; double Dntrend[]; double ExtMapBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(3); SetIndexBuffer(0, Uptrend); //ArraySetAsSeries(Uptrend, true); SetIndexBuffer(1, Dntrend); //ArraySetAsSeries(Dntrend, true); SetIndexBuffer(2, ExtMapBuffer); ArraySetAsSeries(ExtMapBuffer, true); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2); IndicatorShortName("Execute Line("+period+")"); return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { // ???? ????? ?????? ?????? return(0); } //+------------------------------------------------------------------+ //| ?????????? ??????? | //+------------------------------------------------------------------+ double WMA(int x, int p) { return(iMA(NULL, 0, p, 0, method, price, x)); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); int x = 0; int p = MathSqrt(period); int e = Bars - counted_bars + period + 1; double vect[], trend[]; if(e > Bars) e = Bars; ArrayResize(vect, e); ArraySetAsSeries(vect, true); ArrayResize(trend, e); ArraySetAsSeries(trend, true); for(x = 0; x < e; x++) { vect[x] = 2*WMA(x, period/2) - WMA(x, period); // Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period)); } for(x = 0; x < e-period; x++) ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x); for(x = e-period; x >= 0; x--) { trend[x] = trend[x+1]; if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1; if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1; if (trend[x]>0) { Uptrend[x] = ExtMapBuffer[x]; if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1]; Dntrend[x] = EMPTY_VALUE; } else if (trend[x]<0) { Dntrend[x] = ExtMapBuffer[x]; if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1]; Uptrend[x] = EMPTY_VALUE; } //Print( " trend=",trend[x]); } return(0); } //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| HMA.mq4 //| Copyright © 2006 WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak68a1a05faee98ce80bb57fa7648704eb').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy68a1a05faee98ce80bb57fa7648704eb = 'wizardserg' + '@'; addy68a1a05faee98ce80bb57fa7648704eb = addy68a1a05faee98ce80bb57fa7648704eb + 'mail' + '.' + 'ru'; var addy_text68a1a05faee98ce80bb57fa7648704eb = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak68a1a05faee98ce80bb57fa7648704eb').innerHTML += ''+addy_text68a1a05faee98ce80bb57fa7648704eb+''; >, ?? ??????? ForexMagazine #104 //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak90b7ee87046eb64dff6a9496b4f38935').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy90b7ee87046eb64dff6a9496b4f38935 = 'wizardserg' + '@'; addy90b7ee87046eb64dff6a9496b4f38935 = addy90b7ee87046eb64dff6a9496b4f38935 + 'mail' + '.' + 'ru'; var addy_text90b7ee87046eb64dff6a9496b4f38935 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak90b7ee87046eb64dff6a9496b4f38935').innerHTML += ''+addy_text90b7ee87046eb64dff6a9496b4f38935+''; //| Revised by IgorAD,Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakfccc953927a2314ebf95b0fd90fd1b2e').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyfccc953927a2314ebf95b0fd90fd1b2e = 'igorad2003' + '@'; addyfccc953927a2314ebf95b0fd90fd1b2e = addyfccc953927a2314ebf95b0fd90fd1b2e + 'yahoo' + '.' + 'co' + '.' + 'uk'; var addy_textfccc953927a2314ebf95b0fd90fd1b2e = 'igorad2003' + '@' + 'yahoo' + '.' + 'co' + '.' + 'uk';document.getElementById('cloakfccc953927a2314ebf95b0fd90fd1b2e').innerHTML += ''+addy_textfccc953927a2314ebf95b0fd90fd1b2e+''; | //| Personalized by iGoR AKA FXiGoR for the Trend Slope Trading method (T_S_T) //| Link: //| contact: Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak6af8d22728d2acb31ccf80e70c66b32f').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy6af8d22728d2acb31ccf80e70c66b32f = 'thefuturemaster' + '@'; addy6af8d22728d2acb31ccf80e70c66b32f = addy6af8d22728d2acb31ccf80e70c66b32f + 'hotmail' + '.' + 'com'; var addy_text6af8d22728d2acb31ccf80e70c66b32f = 'thefuturemaster' + '@' + 'hotmail' + '.' + 'com';document.getElementById('cloak6af8d22728d2acb31ccf80e70c66b32f').innerHTML += ''+addy_text6af8d22728d2acb31ccf80e70c66b32f+''; //+------------------------------------------------------------------+ #property copyright "MT4 release WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakcd76879c6f84f6c45c33160403468a8b').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addycd76879c6f84f6c45c33160403468a8b = 'wizardserg' + '@'; addycd76879c6f84f6c45c33160403468a8b = addycd76879c6f84f6c45c33160403468a8b + 'mail' + '.' + 'ru'; var addy_textcd76879c6f84f6c45c33160403468a8b = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakcd76879c6f84f6c45c33160403468a8b').innerHTML += ''+addy_textcd76879c6f84f6c45c33160403468a8b+''; >, ?? ??????? ForexMagazine #104" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak87d7da5b806da3670eb0da62512a6118').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy87d7da5b806da3670eb0da62512a6118 = 'wizardserg' + '@'; addy87d7da5b806da3670eb0da62512a6118 = addy87d7da5b806da3670eb0da62512a6118 + 'mail' + '.' + 'ru'; var addy_text87d7da5b806da3670eb0da62512a6118 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak87d7da5b806da3670eb0da62512a6118').innerHTML += ''+addy_text87d7da5b806da3670eb0da62512a6118+''; " #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 LightBlue #property indicator_color2 Tomato //---- input parameters extern int period=80; extern int method=3; // MODE_SMA extern int price=0; // PRICE_CLOSE //---- buffers double Uptrend[]; double Dntrend[]; double ExtMapBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(3); SetIndexBuffer(0, Uptrend); //ArraySetAsSeries(Uptrend, true); SetIndexBuffer(1, Dntrend); //ArraySetAsSeries(Dntrend, true); SetIndexBuffer(2, ExtMapBuffer); ArraySetAsSeries(ExtMapBuffer, true); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2); IndicatorShortName("Slope Direction Line("+period+")"); return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { // ???? ????? ?????? ?????? return(0); } //+------------------------------------------------------------------+ //| ?????????? ??????? | //+------------------------------------------------------------------+ double WMA(int x, int p) { return(iMA(NULL, 0, p, 0, method, price, x)); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); int x = 0; int p = MathSqrt(period); int e = Bars - counted_bars + period + 1; double vect[], trend[]; if(e > Bars) e = Bars; ArrayResize(vect, e); ArraySetAsSeries(vect, true); ArrayResize(trend, e); ArraySetAsSeries(trend, true); for(x = 0; x < e; x++) { vect[x] = 2*WMA(x, period/2) - WMA(x, period); // Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period)); } for(x = 0; x < e-period; x++) ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x); for(x = e-period; x >= 0; x--) { trend[x] = trend[x+1]; if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1; if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1; if (trend[x]>0) { Uptrend[x] = ExtMapBuffer[x]; if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1]; Dntrend[x] = EMPTY_VALUE; } else if (trend[x]<0) { Dntrend[x] = ExtMapBuffer[x]; if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1]; Uptrend[x] = EMPTY_VALUE; } //Print( " trend=",trend[x]); } return(0); } //+------------------------------------------------------------------+

Forex Expert Advisor.

Avviso. I Forex Expert Advisor ed i mercati finanziari comportano rischi. Ti invitiamo a consultare il " Disclaimer " e la " Privacy "