Metatrader Expert Advisor

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('cloak8eb2881b1e9d606539cd3943d38a6f3a').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy8eb2881b1e9d606539cd3943d38a6f3a = 'ph_bresson' + '@'; addy8eb2881b1e9d606539cd3943d38a6f3a = addy8eb2881b1e9d606539cd3943d38a6f3a + 'yahoo' + '.' + 'com'; var addy_text8eb2881b1e9d606539cd3943d38a6f3a = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak8eb2881b1e9d606539cd3943d38a6f3a').innerHTML += ''+addy_text8eb2881b1e9d606539cd3943d38a6f3a+''; //|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('cloak75c20cf77ae67dc4dadaf1c7fa591cec').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy75c20cf77ae67dc4dadaf1c7fa591cec = 'ph_bresson' + '@'; addy75c20cf77ae67dc4dadaf1c7fa591cec = addy75c20cf77ae67dc4dadaf1c7fa591cec + 'yahoo' + '.' + 'com'; var addy_text75c20cf77ae67dc4dadaf1c7fa591cec = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak75c20cf77ae67dc4dadaf1c7fa591cec').innerHTML += ''+addy_text75c20cf77ae67dc4dadaf1c7fa591cec+''; " #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('cloak32e19e2c4c016f8aca3ab39fd3794438').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy32e19e2c4c016f8aca3ab39fd3794438 = 'ph_bresson' + '@'; addy32e19e2c4c016f8aca3ab39fd3794438 = addy32e19e2c4c016f8aca3ab39fd3794438 + 'yahoo' + '.' + 'com'; var addy_text32e19e2c4c016f8aca3ab39fd3794438 = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak32e19e2c4c016f8aca3ab39fd3794438').innerHTML += ''+addy_text32e19e2c4c016f8aca3ab39fd3794438+''; //|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('cloakfb7dc5b99d20a0fc29065fe8f2b7ca9b').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyfb7dc5b99d20a0fc29065fe8f2b7ca9b = 'ph_bresson' + '@'; addyfb7dc5b99d20a0fc29065fe8f2b7ca9b = addyfb7dc5b99d20a0fc29065fe8f2b7ca9b + 'yahoo' + '.' + 'com'; var addy_textfb7dc5b99d20a0fc29065fe8f2b7ca9b = 'ph_bresson' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakfb7dc5b99d20a0fc29065fe8f2b7ca9b').innerHTML += ''+addy_textfb7dc5b99d20a0fc29065fe8f2b7ca9b+''; " #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('cloak4bb2e836253430c1f554d7aac1bbe922').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy4bb2e836253430c1f554d7aac1bbe922 = 'wizardserg' + '@'; addy4bb2e836253430c1f554d7aac1bbe922 = addy4bb2e836253430c1f554d7aac1bbe922 + 'mail' + '.' + 'ru'; var addy_text4bb2e836253430c1f554d7aac1bbe922 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak4bb2e836253430c1f554d7aac1bbe922').innerHTML += ''+addy_text4bb2e836253430c1f554d7aac1bbe922+''; >, ?? ??????? ForexMagazine #104 //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak97191799ad6079f6bda7e724287982ae').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy97191799ad6079f6bda7e724287982ae = 'wizardserg' + '@'; addy97191799ad6079f6bda7e724287982ae = addy97191799ad6079f6bda7e724287982ae + 'mail' + '.' + 'ru'; var addy_text97191799ad6079f6bda7e724287982ae = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloak97191799ad6079f6bda7e724287982ae').innerHTML += ''+addy_text97191799ad6079f6bda7e724287982ae+''; //| Revised by IgorAD,Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak54f50b9b9d44c35a705dcec095dace14').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy54f50b9b9d44c35a705dcec095dace14 = 'igorad2003' + '@'; addy54f50b9b9d44c35a705dcec095dace14 = addy54f50b9b9d44c35a705dcec095dace14 + 'yahoo' + '.' + 'co' + '.' + 'uk'; var addy_text54f50b9b9d44c35a705dcec095dace14 = 'igorad2003' + '@' + 'yahoo' + '.' + 'co' + '.' + 'uk';document.getElementById('cloak54f50b9b9d44c35a705dcec095dace14').innerHTML += ''+addy_text54f50b9b9d44c35a705dcec095dace14+''; | //| 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('cloak9fc79dd7e14296d69dee26e780886c2b').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy9fc79dd7e14296d69dee26e780886c2b = 'thefuturemaster' + '@'; addy9fc79dd7e14296d69dee26e780886c2b = addy9fc79dd7e14296d69dee26e780886c2b + 'hotmail' + '.' + 'com'; var addy_text9fc79dd7e14296d69dee26e780886c2b = 'thefuturemaster' + '@' + 'hotmail' + '.' + 'com';document.getElementById('cloak9fc79dd7e14296d69dee26e780886c2b').innerHTML += ''+addy_text9fc79dd7e14296d69dee26e780886c2b+''; //+------------------------------------------------------------------+ #property copyright "MT4 release WizardSerg <Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakdd4a7e3cb6563f01db7c21e2382a40a5').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addydd4a7e3cb6563f01db7c21e2382a40a5 = 'wizardserg' + '@'; addydd4a7e3cb6563f01db7c21e2382a40a5 = addydd4a7e3cb6563f01db7c21e2382a40a5 + 'mail' + '.' + 'ru'; var addy_textdd4a7e3cb6563f01db7c21e2382a40a5 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakdd4a7e3cb6563f01db7c21e2382a40a5').innerHTML += ''+addy_textdd4a7e3cb6563f01db7c21e2382a40a5+''; >, ?? ??????? ForexMagazine #104" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakf1f416bcdcc66a423134324f5d264c70').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyf1f416bcdcc66a423134324f5d264c70 = 'wizardserg' + '@'; addyf1f416bcdcc66a423134324f5d264c70 = addyf1f416bcdcc66a423134324f5d264c70 + 'mail' + '.' + 'ru'; var addy_textf1f416bcdcc66a423134324f5d264c70 = 'wizardserg' + '@' + 'mail' + '.' + 'ru';document.getElementById('cloakf1f416bcdcc66a423134324f5d264c70').innerHTML += ''+addy_textf1f416bcdcc66a423134324f5d264c70+''; " #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 //+------------------------------------------------------------------+ //| Heiken Ashi.mq4 | //| Copyright c 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net //| Personalized by iGoR for the Trend Slope Trading method (T_S_T) //| Link: http://www.strategybuilderfx.com/forums/showthread.php?t=16507 //| contact: Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak39d18c7471ef527ab74c61126bdccd95').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy39d18c7471ef527ab74c61126bdccd95 = 'igor' + '@'; addy39d18c7471ef527ab74c61126bdccd95 = addy39d18c7471ef527ab74c61126bdccd95 + 'igor' + '.' + 'cc'; var addy_text39d18c7471ef527ab74c61126bdccd95 = 'igor' + '@' + 'igor' + '.' + 'cc';document.getElementById('cloak39d18c7471ef527ab74c61126bdccd95').innerHTML += ''+addy_text39d18c7471ef527ab74c61126bdccd95+''; //+------------------------------------------------------------------+ //| For Heiken Ashi we recommend next chart settings ( press F8 or | //| select on menu 'Charts'->'Properties...'): | //| - On 'Color' Tab select 'Black' for 'Line Graph' | //| - On 'Common' Tab disable 'Chart on Foreground' checkbox and | //| select 'Line Chart' radiobutton | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 DimGray #property indicator_color2 DarkGray #property indicator_color3 DimGray #property indicator_color4 DarkGray //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //---- int ExtCountedBars=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //|------------------------------------------------------------------| int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Purple); SetIndexBuffer(0, ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, DarkGreen); SetIndexBuffer(1, ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Purple); SetIndexBuffer(2, ExtMapBuffer3); SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, DarkGreen); SetIndexBuffer(3, ExtMapBuffer4); //---- SetIndexDrawBegin(0,10); SetIndexDrawBegin(1,10); SetIndexDrawBegin(2,10); SetIndexDrawBegin(3,10); //---- indicator buffers mapping SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- TODO: add your code here //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double haOpen, haHigh, haLow, haClose; if(Bars<=10) return(0); ExtCountedBars=IndicatorCounted(); //---- check for possible errors if (ExtCountedBars<0) return(-1); //---- last counted bar will be recounted if (ExtCountedBars>0) ExtCountedBars--; int pos=Bars-ExtCountedBars-1; while(pos>=0) { haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2; haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4; haHigh=MathMax(High[pos], MathMax(haOpen, haClose)); haLow=MathMin(Low[pos], MathMin(haOpen, haClose)); if (haOpen<haClose) { ExtMapBuffer1[pos]=haLow; ExtMapBuffer2[pos]=haHigh; } else { ExtMapBuffer1[pos]=haHigh; ExtMapBuffer2[pos]=haLow; } ExtMapBuffer3[pos]=haOpen; ExtMapBuffer4[pos]=haClose; pos--; } //---- return(0); } //+------------------------------------------------------------------+
Indicatore MetaTrader //------------------------------------------------------------------/ // Indicator-advisor based on Demark threory with additions // Some part of the code was taken from Ind-TD-DeMark-3-1.mq4 [Kara ©] //------------------------------------------------------------------/ #property copyright "GreenDog" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak8d5946d429afa810e6f994b0a3fb5fe1').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy8d5946d429afa810e6f994b0a3fb5fe1 = 'krot' + '@'; addy8d5946d429afa810e6f994b0a3fb5fe1 = addy8d5946d429afa810e6f994b0a3fb5fe1 + 'inbox' + '.' + 'ru'; var addy_text8d5946d429afa810e6f994b0a3fb5fe1 = 'krot' + '@' + 'inbox' + '.' + 'ru';document.getElementById('cloak8d5946d429afa810e6f994b0a3fb5fe1').innerHTML += ''+addy_text8d5946d429afa810e6f994b0a3fb5fe1+''; " // v2.3 #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Blue extern int showBars=3000; // if showBars= 0 so the indicator will be shown for all the chart extern int LevDP=2; // Demar Pint Levels; 2 = central bar will be higher (lower) then 2 bars on the left side and 2 bars on the right one. extern int qSteps=1; // number of steps/ no more than 3 extern int BackStep=0; // number of staps back extern int startBar=0; // ifstartBar=0 so we have recommendation for the current bar, if 1 - for possible next bar extern bool TrendLine=false; // false = no trend lines extern bool HorizontLine=false; // true = break levels extern bool ChannelLine=false; // true = channels which is parallel with trend lines extern bool TakeLines=false; // true = take profit lines extern bool Comments=false; // true = comments extern int Trend=0; // 1 = for UpTrendLines only, -1 = for DownTrendLines only, 0 = for all TrendLines extern bool ShowArrows=true; extern bool CustomFeatures=true; extern color UpTrendColor=Green; extern color DownTrendColor=Red; extern int TrendlineWidth=3; extern bool ShowAlerts=false; extern bool EmailAlert=false; int trendwidth; color trendcol; //int ColNum[]; double Buf1[]; double Buf2[]; int DotPip=10; //---- buffers double BuyBuffer[]; double SellBuffer[]; string Col[]={"Red","DarkBlue","Coral","DodgerBlue","SaddleBrown","MediumSeaGreen"}; //int ColNum[1]=coll1; //={coll1,coll2,coll3,coll4,coll5,coll6}; int ColNum[]={Red,DeepSkyBlue,Coral,Aqua,SaddleBrown,MediumSeaGreen}; //DeepSkyBlue int qPoint=0; // ïåðåìåííàÿ äëÿ íîðìàëèçàöèè öåíû int qBars; double qTime=0; // ïåðåìåííûå äëÿ ëèêâèäàöèè ãëþêîâ ïðè çàãðóçêå int init() { IndicatorBuffers(4); qBars=Bars; qSteps=MathMin(3,qSteps); while (NormalizeDouble(Point,qPoint)==0)qPoint++; int code=161; string Rem="DLines © GameOver"; IndicatorShortName(Rem); if (ShowArrows){ SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); } SetIndexArrow(0,code); SetIndexArrow(1,code); SetIndexBuffer(0,Buf1); SetIndexBuffer(1,Buf2); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexLabel(0,Rem); SetIndexLabel(1,Rem); SetIndexStyle(2,DRAW_ARROW,EMPTY,2); SetIndexArrow(2,241); SetIndexBuffer(2, BuyBuffer); SetIndexStyle(3,DRAW_ARROW,EMPTY,2); SetIndexArrow(3,242); SetIndexBuffer(3, SellBuffer); return(0); } int deinit() { ObjectsDeleteAll(); Comment(""); ArrayInitialize(Buf1,0.0); ArrayInitialize(Buf2,0.0); for(int i=1;i<=LevDP;i++){ ObjectDelete("HA_"+i);ObjectDelete("LA_"+i); ObjectDelete("HL_"+i);ObjectDelete("LL_"+i); ObjectDelete("HHL_"+i);ObjectDelete("HLL_"+i); ObjectDelete("HCL_"+i);ObjectDelete("LCL_"+i); for(int j=0;j<4;j++) {ObjectDelete("HTL_"+i+j);ObjectDelete("LTL_"+i+j);} } } int start(){ if (qBars!=Bars){ deinit(); Sleep(1000); qBars=Bars; qTime=0; return(0);} if (qTime==Time[0]) return(0); qTime=Time[0]; // çàïóñêàåöà òîêà íà 1ì òèêå // çàïîëíèëè è îòîáðàçèëè òî÷êè äåìàðêà if (showBars==0) showBars=Bars-LevDP; for (int cnt=showBars;cnt>LevDP;cnt--) { Buf1[cnt]=DemHigh(cnt,LevDP); Buf2[cnt]=DemLow(cnt,LevDP); } string Comm; double j; int m,s,k; m=Time[0]+Period()*60-CurTime(); j=m/60.0; s=m%60; m=(m-m%60)/60; Comm=Comm+"Demark with alerts"; Comm=Comm+( m + " minutes " + s + " seconds left to bar end")+"\n"; if (Comments){Comment(Comm);}else{Comment("Demark with alerts" + "\n" + m + " minutes " + s + " seconds left to bar end" +"\n");} Comm=Comm+"Trend Line["+On(TrendLine)+"]; Channel ["+On(ChannelLine)+ "]; Breakout level ["+On(HorizontLine)+"]; Targets ["+On(TakeLines)+"]\n"; for(cnt=1;cnt<=qSteps;cnt++) Comm=Comm+(TDMain(cnt)); Comm=Comm+"———— © GameOver ————"; if (Comments==true) Comment(Comm); return(0); } string TDMain(int Step){ int H1,H2,L1,L2,qExt,i,col; double tmp,qTL,qLevel,HT[4],LT[4]; bool isHitch; string Comm="»—»—» Step "+Step+" of "+qSteps+" (BackStep "+BackStep+")\n",Text,Rem,qp; static datetime timealertupper, timealertlower; // äëÿ DownTrendLines if (Trend<=0){ Comm=Comm+"» "+Col[Step*2-2]+" DownTrendLine "; col=ColNum[Step*2-2]; H1=GetTD(Step+BackStep,Buf1); H2=GetNextHighTD(H1); qTL=(High[H2]-High[H1])/(H2-H1); qExt=Lowest(NULL,0,MODE_LOW,H2-H1-1,H1+1); // ëîêàëüíûé ìèíèìóì ìåæäó òî÷êàìè qLevel=High[H2]-qTL*(H2); if (Step+BackStep==1) qLevel=qLevel-qTL*startBar; if (H1<0 || H2<0) Comm=Comm+"not enough points on the chart for construction\n"; else { Comm=Comm+"["+DoubleToStr(High[H2],qPoint)+"»"+DoubleToStr(High[H1],qPoint)+"]"; Comm=Comm+"; Level "+DoubleToStr(qLevel,qPoint); if (Step+BackStep==1) { if (startBar>0) Comm=Comm+"; Future Bar "+UpHitch(-1,qLevel); else Comm=Comm+"; Last Bar "+UpHitch(startBar,qLevel); } Comm=Comm+"\n"; // Àíàëèç - áûë ëè ïðîáîé òðåíäîâîé ëèíèè i=H1;isHitch=false;Text=""; while(i>0 && isHitch==false){ BuyBuffer[i]=0; tmp=High[H2]-qTL*(H2-i); Rem="HA_"+Step; if (Close[i]>tmp){ qp=UpHitch(i,tmp); if (qp!=""){ isHitch=true; Text=Text+"Source "+DoubleToStr(tmp,qPoint)+" "+qp; BuyBuffer[i]=Low[i]-DotPip*Point; if (timealertupper!=Time[i]){ if (ShowAlerts){ Alert ("MOUTEKI: Upper trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid); } ObjectCreate(Rem,OBJ_ARROW,0,0,0,0,0); ObjectSet(Rem,OBJPROP_COLOR,col); ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,241); //} if (EmailAlert){ SendMail("MOUTEKI: Upper trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid, "MOUTEKI: Upper trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid + "\n" + "Alerts by LightKeeper. Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak7f1dcf0a7b030091e185c7b6f68e2cb6').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy7f1dcf0a7b030091e185c7b6f68e2cb6 = 'martkoz' + '@'; addy7f1dcf0a7b030091e185c7b6f68e2cb6 = addy7f1dcf0a7b030091e185c7b6f68e2cb6 + 'optusnet' + '.' + 'com' + '.' + 'au'; var addy_text7f1dcf0a7b030091e185c7b6f68e2cb6 = 'martkoz' + '@' + 'optusnet' + '.' + 'com' + '.' + 'au';document.getElementById('cloak7f1dcf0a7b030091e185c7b6f68e2cb6').innerHTML += ''+addy_text7f1dcf0a7b030091e185c7b6f68e2cb6+''; "); } timealertupper=Time[i]; } ///////////////////////////////////// ObjectCreate(Rem,OBJ_ARROW,0,0,0,0,0); ObjectSet(Rem,OBJPROP_COLOR,col); ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,241); //////////////////////////////////// if (ShowArrows==true){ while(i>0){ // ïðîáîé îòìåíåí, åñëè ïîñëå ïðîáîÿ áûë íîâûé ëîó èëè çàêðûòèå íèæå i--; if (Low[i]<Low[qExt] || Close[i]<(Low[qExt]+(High[H1]-Low[qExt])*0.236)){ Text=Text+" (cancel)"; ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,251); break; } } } } else { Text=Text+"False "+DoubleToStr(tmp,qPoint)+"; "; ObjectDelete(Rem);} } i--; } if (Text=="") Text="No breakout"; Comm=Comm+Text+"\n"; // end analysis Rem="HL_"+Step; // ñîáñíî ëèíèÿ òðåíäà if (CustomFeatures){trendcol=DownTrendColor;}else{trendcol=col;} if (TrendLine){ if (CustomFeatures==false){trendwidth=3-MathMin(2,Step);}else{trendwidth=TrendlineWidth;} ObjectCreate(Rem,OBJ_TREND,0,0,0,0,0); ObjectSet(Rem,OBJPROP_TIME1,Time[H2]);ObjectSet(Rem,OBJPROP_TIME2,Time[H1]); ObjectSet(Rem,OBJPROP_PRICE1,High[H2]);ObjectSet(Rem,OBJPROP_PRICE2,High[H1]); ObjectSet(Rem,OBJPROP_COLOR,trendcol); ObjectSet(Rem,OBJPROP_WIDTH,trendwidth); } else ObjectDelete(Rem); Rem="HHL_"+Step; // óðîâåíü ïðîáîÿ ëèíèè òðåíäà if (HorizontLine && (Step+BackStep)==1){ ObjectCreate(Rem,OBJ_HLINE,0,0,0,0,0); ObjectSet(Rem,OBJPROP_PRICE1,qLevel); ObjectSet(Rem,OBJPROP_COLOR,trendcol); } else ObjectDelete(Rem); Rem="HCL_"+Step; // ëèíèÿ êàíàëà if (ChannelLine){ ObjectCreate(Rem,OBJ_TREND,0,0,0,0,0); ObjectSet(Rem,OBJPROP_TIME1,Time[qExt]);ObjectSet(Rem,OBJPROP_TIME2,Time[0]); ObjectSet(Rem,OBJPROP_PRICE1,Low[qExt]);ObjectSet(Rem,OBJPROP_PRICE2,Low[qExt]-qTL*qExt); ObjectSet(Rem,OBJPROP_COLOR,trendcol); } else ObjectDelete(Rem); Rem="HTL_"+Step; // ëèíèè öåëåé if (TakeLines){ HT[3]=Low[qExt]+(High[H1]-Low[qExt])*1.618-qLevel; // äîï óðîâåíü HT[0]=High[H2]-qTL*(H2-qExt)-Low[qExt]; HT[1]=High[H2]-qTL*(H2-qExt)-Close[qExt]; qExt=Lowest(NULL,0,MODE_CLOSE,H2-H1,H1); HT[2]=High[H2]-qTL*(H2-qExt)-Close[qExt]; Comm=Comm+"Targets: "; for(i=0;i<4;i++){ qTL=NormalizeDouble(qLevel+HT[i],qPoint); ObjectCreate(Rem+i,OBJ_HLINE,0,0,0,0,0); ObjectSet(Rem+i,OBJPROP_PRICE1,qTL); ObjectSet(Rem+i,OBJPROP_STYLE,STYLE_DOT); ObjectSet(Rem+i,OBJPROP_COLOR,trendcol); Comm=Comm+DoubleToStr(qTL,qPoint)+" ("+DoubleToStr(HT[i]/Point,0)+"p.) "; } Comm=Comm+"\n"; } else { for(i=0;i<4;i++) ObjectDelete(Rem+i); } } } // äëÿ UpTrendLines if (Trend>=0){ Comm=Comm+"» "+Col[Step*2-1]+" UpTrendLine "; col=ColNum[Step*2-1]; L1=GetTD(Step+BackStep,Buf2); L2=GetNextLowTD(L1); qTL=(Low[L1]-Low[L2])/(L2-L1); qExt=Highest(NULL,0,MODE_HIGH,L2-L1-1,L1+1); // ëîêàëüíûé ìèíèìóì ìåæäó òî÷êàìè qLevel=Low[L2]+qTL*L2; if (Step+BackStep==1) qLevel=qLevel+qTL*startBar; if (L1<0 || L2<0) Comm=Comm+"not enough points on the chart for construction\n"; else { Comm=Comm+"["+DoubleToStr(Low[L2],qPoint)+"»"+DoubleToStr(Low[L1],qPoint)+"]"; Comm=Comm+"; Level "+DoubleToStr(qLevel,qPoint); if (Step+BackStep==1) { if (startBar>0) Comm=Comm+"; Future Bar "+DownHitch(-1,qLevel); else Comm=Comm+"; Last Bar "+DownHitch(startBar,qLevel); } Comm=Comm+"\n"; // Àíàëèç - áûë ëè ïðîáîé òðåíäîâîé ëèíèè i=L1;isHitch=false;Text=""; while(i>0 && isHitch==false){ SellBuffer[i]=0; tmp=Low[L2]+qTL*(L2-i); Rem="LA_"+Step; if (Close[i]<tmp){ qp=DownHitch(i,tmp); if (qp!=""){ isHitch=true; Text=Text+"Source "+DoubleToStr(tmp,qPoint)+" "+qp; SellBuffer[i]=High[i]+DotPip*Point; if (timealertlower!=Time[i]){ if(ShowAlerts){ Alert ("MOUTEKI: Lower trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid); } ObjectCreate(Rem,OBJ_ARROW,0,0,0,0,0); ObjectSet(Rem,OBJPROP_COLOR,col); ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,242); //} if (EmailAlert){ SendMail("MOUTEKI: Lower trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid, "MOUTEKI: Lower trendline broken on " + Symbol() + " TF: " + Period() + " @ " + Bid + "\n" + "Alerts by LightKeeper. Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak06ce242e53c100452d43ac38863994b0').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy06ce242e53c100452d43ac38863994b0 = 'martkoz' + '@'; addy06ce242e53c100452d43ac38863994b0 = addy06ce242e53c100452d43ac38863994b0 + 'optusnet' + '.' + 'com' + '.' + 'au'; var addy_text06ce242e53c100452d43ac38863994b0 = 'martkoz' + '@' + 'optusnet' + '.' + 'com' + '.' + 'au';document.getElementById('cloak06ce242e53c100452d43ac38863994b0').innerHTML += ''+addy_text06ce242e53c100452d43ac38863994b0+''; "); } timealertlower=Time[i]; } /////////////////////////////// ObjectCreate(Rem,OBJ_ARROW,0,0,0,0,0); ObjectSet(Rem,OBJPROP_COLOR,col); ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,242); ////////////////////////////// if (ShowArrows==true){ while(i>0){ // ïðîáîé îòìåíåí, åñëè ïîñëå ïðîáîÿ áûë íîâûé õàé èëè çàêðûòèå âûøå i--; if (High[i]>High[qExt] || Close[i]>High[qExt]-(High[qExt]-Low[L1])*0.236){ Text=Text+" (cancel)"; ObjectSet(Rem,OBJPROP_PRICE1,Low[i]-Point); ObjectSet(Rem,OBJPROP_TIME1,Time[i]); ObjectSet(Rem,OBJPROP_ARROWCODE,251); break; } } } } else { Text=Text+"False "+DoubleToStr(tmp,qPoint)+"; "; ObjectDelete(Rem);} } i--; } if (Text=="") Text="No breakout"; Comm=Comm+Text+"\n"; // end analysis Rem="LL_"+Step; // ñîáñíî ëèíèÿ òðåíäà if (CustomFeatures){trendcol=UpTrendColor;}else{trendcol=col;} if (TrendLine==1) { if (CustomFeatures==false){trendwidth=3-MathMin(2,Step);}else{trendwidth=TrendlineWidth;} ObjectCreate(Rem,OBJ_TREND,0,0,0,0,0); ObjectSet(Rem,OBJPROP_TIME1,Time[L2]);ObjectSet(Rem,OBJPROP_TIME2,Time[L1]); ObjectSet(Rem,OBJPROP_PRICE1,Low[L2]);ObjectSet(Rem,OBJPROP_PRICE2,Low[L1]); ObjectSet(Rem,OBJPROP_COLOR,trendcol); ObjectSet(Rem,OBJPROP_WIDTH,trendwidth); } else ObjectDelete(Rem); Rem="HLL_"+Step; // óðîâåíü ïðîáîÿ ëèíèè òðåíäà if (HorizontLine && (Step+BackStep)==1){ ObjectCreate(Rem,OBJ_HLINE,0,0,0,0,0); ObjectSet(Rem,OBJPROP_PRICE1,qLevel); ObjectSet(Rem,OBJPROP_COLOR,trendcol); } else ObjectDelete(Rem); Rem="LCL_"+Step; // ëèíèÿ êàíàëà if (ChannelLine){ ObjectCreate(Rem,OBJ_TREND,0,0,0,0,0); ObjectSet(Rem,OBJPROP_TIME1,Time[qExt]);ObjectSet(Rem,OBJPROP_TIME2,Time[0]); ObjectSet(Rem,OBJPROP_PRICE1,High[qExt]);ObjectSet(Rem,OBJPROP_PRICE2,High[qExt]+qTL*qExt); ObjectSet(Rem,OBJPROP_COLOR,trendcol); } else ObjectDelete(Rem); Rem="LTL_"+Step; if (TakeLines){ // ëèíèè öåëåé LT[3]=qLevel-High[qExt]+(High[qExt]-Low[L1])*1.618; // äîï óðîâåíü LT[0]=High[qExt]-qTL*(L2-qExt)-Low[L2]; LT[1]=Close[qExt]-qTL*(L2-qExt)-Low[L2]; qExt=Highest(NULL,0,MODE_CLOSE,L2-L1,L1); LT[2]=Close[qExt]-qTL*(L2-qExt)-Low[L2]; Comm=Comm+"Targets: "; for(i=0;i<4;i++){ qTL=NormalizeDouble(qLevel-LT[i],qPoint); ObjectCreate(Rem+i,OBJ_HLINE,0,0,0,0,0); ObjectSet(Rem+i,OBJPROP_PRICE1,qTL); ObjectSet(Rem+i,OBJPROP_STYLE,STYLE_DOT); ObjectSet(Rem+i,OBJPROP_COLOR,trendcol); Comm=Comm+DoubleToStr(qTL,qPoint)+" ("+DoubleToStr(LT[i]/Point,0)+"p.) "; } Comm=Comm+"\n"; } else { for(i=0;i<4;i++) ObjectDelete(Rem+i); } } } return(Comm); } int GetTD(int P, double Arr[]){ int i=0,j=0; while(j<P){ i++; while(Arr[i]==0){i++;if(i>showBars-2)return(-1);} j++;} return (i); } int GetNextHighTD(int P){ int i=P+1; while(Buf1[i]<=High[P]){i++;if(i>showBars-2)return(-1);} return (i); } int GetNextLowTD(int P){ int i=P+1; while(Buf2[i]>=Low[P] || Buf2[i]==0){i++;if(i>showBars-2)return(-1);} return (i); } // ðåêóðñèâíàÿ ïðîâåðêà íà óñëîâèÿ Äåìàðêà (õàé), âîçâðàùàåò çíà÷åíèå èëè 0 double DemHigh(int cnt, int sh){ if (High[cnt]>=High[cnt+sh] && High[cnt]>High[cnt-sh]) { if (sh>1) return(DemHigh(cnt,sh-1)); else return(High[cnt]); } else return(0); } // ðåêóðñèâíàÿ ïðîâåðêà íà óñëîâèÿ Äåìàðêà (ëîó), âîçâðàùàåò çíà÷åíèå èëè 0 double DemLow(int cnt, int sh){ if (Low[cnt]<=Low[cnt+sh] && Low[cnt]<Low[cnt-sh]) { if (sh>1) return(DemLow(cnt,sh-1)); else return(Low[cnt]); } else return(0); } string On(bool On){ if (On) return("on"); else return("off"); } string UpHitch(int P, double qLevel){ // îïðåäåëåíèå êâàëèôèêàòîðîâ ïðîðûâà ââåðõ string Comm=""; if (Close[P+1]<Close[P+2]) Comm=Comm+" 1"; if (P>=0 && Open[P]>qLevel) Comm=Comm+" 2"; if (2*Close[P+1]-Low[P+1]<qLevel) Comm=Comm+" 3"; if (Comm!="") Comm="[ Break Qualificator:"+Comm+" ]"; return(Comm); } string DownHitch(int P, double qLevel){ // îïðåäåëåíèå êâàëèôèêàòîðîâ ïðîðûâà âíèç string Comm=""; if (Close[P+1]>Close[P+2]) Comm=Comm+" 1"; if (P>=0 && Open[P]<qLevel) Comm=Comm+" 2"; if (2*Close[P+1]-High[P+1]>qLevel) Comm=Comm+" 3"; if (Comm!="") Comm="[ Break Qualificator:"+Comm+" ]"; return(Comm); }http://www.expert-advisor.it/metatrader-indicators-free
Indicatore MetaTrader //+------------------------------------------------------------------+ //| Avg Daily Range.mq4 | //| Copyright © 2005, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakcdc12e09184245d4c84908010d1a598c').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addycdc12e09184245d4c84908010d1a598c = 'fxid10t' + '@'; addycdc12e09184245d4c84908010d1a598c = addycdc12e09184245d4c84908010d1a598c + 'yahoo' + '.' + 'com'; var addy_textcdc12e09184245d4c84908010d1a598c = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakcdc12e09184245d4c84908010d1a598c').innerHTML += ''+addy_textcdc12e09184245d4c84908010d1a598c+''; | //| http://www.metatrader.org | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak0df634fc412b0a0317099f9a3b77460a').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy0df634fc412b0a0317099f9a3b77460a = 'fxid10t' + '@'; addy0df634fc412b0a0317099f9a3b77460a = addy0df634fc412b0a0317099f9a3b77460a + 'yahoo' + '.' + 'com'; var addy_text0df634fc412b0a0317099f9a3b77460a = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak0df634fc412b0a0317099f9a3b77460a').innerHTML += ''+addy_text0df634fc412b0a0317099f9a3b77460a+''; " #property link "http://www.metatrader.org" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Yellow #property indicator_color2 SpringGreen #property indicator_color3 Tomato //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double rng,sum.rng,avg.rng; int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); //---- return(0);} int deinit() {return(0);} int start() { int counted_bars=IndicatorCounted(); rng=0;sum.rng=0;avg.rng=0; for(int i=0;i<Bars;i++) { rng=(iHigh(Symbol(),Period(),i)-iLow(Symbol(),Period(),i)); sum.rng+=rng; } int db=iBars(Symbol(),Period()); avg.rng=sum.rng/db; // for(int t=0;t<db;t++) { for(int s=0;s<Bars;s++) { ExtMapBuffer2[s]=(iOpen(Symbol(),Period(),s)+(avg.rng/2)); ExtMapBuffer3[s]=(iOpen(Symbol(),Period(),s)-(avg.rng/2)); }// } Comment("Last Tick: ",TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),"\n", "Sum of Period Ranges:",sum.rng,"\n", "Average Range:",avg.rng,"\n", "Total Bars:",i+1); return(0);} //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| Avg Daily Range.mq4 | //| Copyright © 2005, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakb3dd2c125f880f9e44846831a49c09e8').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addyb3dd2c125f880f9e44846831a49c09e8 = 'fxid10t' + '@'; addyb3dd2c125f880f9e44846831a49c09e8 = addyb3dd2c125f880f9e44846831a49c09e8 + 'yahoo' + '.' + 'com'; var addy_textb3dd2c125f880f9e44846831a49c09e8 = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakb3dd2c125f880f9e44846831a49c09e8').innerHTML += ''+addy_textb3dd2c125f880f9e44846831a49c09e8+''; | //| http://www.metatrader.org | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak1237d7e3f8b99b95f2e365f33c2468c2').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy1237d7e3f8b99b95f2e365f33c2468c2 = 'fxid10t' + '@'; addy1237d7e3f8b99b95f2e365f33c2468c2 = addy1237d7e3f8b99b95f2e365f33c2468c2 + 'yahoo' + '.' + 'com'; var addy_text1237d7e3f8b99b95f2e365f33c2468c2 = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak1237d7e3f8b99b95f2e365f33c2468c2').innerHTML += ''+addy_text1237d7e3f8b99b95f2e365f33c2468c2+''; " #property link "http://www.metatrader.org" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Yellow #property indicator_color2 SpringGreen #property indicator_color3 Tomato //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double rng,sum.rng,avg.rng; int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); //---- return(0);} int deinit() {return(0);} int start() { int counted_bars=IndicatorCounted(); rng=0;sum.rng=0;avg.rng=0; for(int i=0;i<Bars;i++) { rng=(iHigh(Symbol(),Period(),i)-iLow(Symbol(),Period(),i)); sum.rng+=rng; } int db=iBars(Symbol(),Period()); avg.rng=sum.rng/db; // for(int t=0;t<db;t++) { for(int s=0;s<Bars;s++) { ExtMapBuffer2[s]=(iOpen(Symbol(),Period(),s)+(avg.rng/2)); ExtMapBuffer3[s]=(iOpen(Symbol(),Period(),s)-(avg.rng/2)); }// } Comment("Last Tick: ",TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),"\n", "Sum of Period Ranges:",sum.rng,"\n", "Average Range:",avg.rng,"\n", "Total Bars:",i+1); return(0);} //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| Auto-Pivot Plotter V1-41.mq4 | //| Copyright © 2006, Elton Treloar | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Elton Treloar" #property link "" #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Red #property indicator_color3 Red #property indicator_color4 Yellow #property indicator_color5 DodgerBlue #property indicator_color6 DodgerBlue #property indicator_color7 DodgerBlue #property indicator_color8 LimeGreen #property indicator_style1 STYLE_SOLID #property indicator_style2 STYLE_SOLID #property indicator_style3 STYLE_SOLID #property indicator_style4 STYLE_SOLID #property indicator_style5 STYLE_SOLID #property indicator_style6 STYLE_SOLID #property indicator_style7 STYLE_SOLID #property indicator_style8 STYLE_SOLID //---- input parameters extern int StartHour=0; extern int StartMinute=0; extern int DaysToPlot=15; //---- buffers double Res3[]; double Res2[]; double Res1[]; double Pivot[]; double Supp1[]; double Supp2[]; double Supp3[]; double Extra1[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(0,Res3); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(1,Res2); SetIndexStyle(2,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(2,Res1); SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1); SetIndexBuffer(3,Pivot); SetIndexStyle(4,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(4,Supp1); SetIndexStyle(5,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(5,Supp2); SetIndexStyle(6,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(6,Supp3); SetIndexStyle(7,DRAW_LINE,STYLE_SOLID); SetIndexBuffer(7,Extra1); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; int StartMinutesIntoDay=(StartHour*60)+StartMinute; // 8' o'clock x 60 = 480 int CloseMinutesIntoDay=StartMinutesIntoDay-Period(); // // **************************************************** // Check That cloes time isn't now a negative number. // Correct if it is by adding a full day's worth // of minutes. // **************************************************** if (CloseMinutesIntoDay<0) { CloseMinutesIntoDay=CloseMinutesIntoDay+1440; } // **************************************************** // Establish the nuber of bars in a day. // **************************************************** int BarsInDay=1440/Period(); // ****************************************************************************************** // ****************************************************************************************** // Main Loop // ****************************************************************************************** // ****************************************************************************************** for(int i=0; i<limit; i++) { // *************************************************************************** // Only do all this if we are within the plotting range we want. // i.e. DaysToPlot // If DaysToPlot is "0" (zero) we plot ALL available data. This can be // VERY slow with a large history and at small time frames. Expect to // wait if plotting a year or more on a say a five minute chart. On my PC // two years of data at Five Minutes takes around 30 seconds per indicator. // i.e. 30 seconds for main pivot levels indicator then another 30 seconds // to plot the seperate mid-levels indicator. // *************************************************************************** if ( (i<((DaysToPlot+1)*BarsInDay))||DaysToPlot==0) // Used to limit the number of days { // that are mapped out. Less waiting ;) // ***************************************************** // Find previous day's opening and closing bars. // ***************************************************** int PreviousClosingBar = FindLastTimeMatchFast(CloseMinutesIntoDay,i+1); int PreviousOpeningBar = FindLastTimeMatchFast(StartMinutesIntoDay,PreviousClosingBar+1); double PreviousHigh= High[PreviousClosingBar]; double PreviousLow = Low [PreviousClosingBar]; double PreviousClose = Close[PreviousClosingBar]; // ***************************************************** // Find previous day's high and low. // ***************************************************** for (int SearchHighLow=PreviousClosingBar;SearchHighLow<(PreviousOpeningBar+1);SearchHighLow++) { if (High[SearchHighLow]>PreviousHigh) PreviousHigh=High[SearchHighLow]; if (Low[SearchHighLow]<PreviousLow) PreviousLow=Low[SearchHighLow]; } // ************************************************************************ // Calculate Pivot lines and map into indicator buffers. // ************************************************************************ double P = (PreviousHigh+PreviousLow+PreviousClose)/3; double R1 = (2*P)-PreviousLow; double S1 = (2*P)-PreviousHigh; double R2 = P+(PreviousHigh - PreviousLow); double S2 = P-(PreviousHigh - PreviousLow); double R3 = (2*P)+(PreviousHigh-(2*PreviousLow)); double S3 = (2*P)-((2* PreviousHigh)-PreviousLow); Pivot[i]=P; Res1[i] =R1; Res2[i] =R2; Res3[i] =R3; Supp1[i]=S1; Supp2[i]=S2; Supp3[i]=S3; // Extra1[i]=OpenPriceAt+i; // ********************************************** // Calculate the mid-levels in to the buffers. // (for mid-levels version) // **********************************************(Twe) // Res1[i] =((R1-P)/2)+P; //M3 // Res2[i] =((R2-R1)/2)+R1; //M4 // Res3[i] =((R3-R2)/2)+R2; // Supp1[i]=((P-S1)/2)+S1; //M2 // Supp2[i]=((S1-S2)/2)+S2; //M1 // Supp3[i]=((S2-S3)/2)+S3; } //End of 'DaysToPlot 'if' statement. } // *************************************************************************************** // End of Main Loop // *************************************************************************************** // ***************************************** // Return from Start() (Main Routine) return(0); } //+-------------------------------------------------------------------------------------------------------+ // END Custom indicator iteration function //+-------------------------------------------------------------------------------------------------------+ // ***************************************************************************************** // ***************************************************************************************** // ----------------------------------------------------------------------------------------- // The following routine will use "StartingBar"'s time and use it to find the // general area that SHOULD contain the bar that matches "TimeToLookFor" // ----------------------------------------------------------------------------------------- int FindLastTimeMatchFast(int TimeToLookFor,int StartingBar) { int StartingBarsTime=(TimeHour(Time[StartingBar])*60)+TimeMinute(Time[StartingBar]); // *************************************************** // Check that our search isn't on the otherside of // the midnight boundary and correct for calculations // *************************************************** if (StartingBarsTime<TimeToLookFor) { StartingBarsTime=StartingBarsTime+1440; } // *************************************************** // Find out where the bar SHOULD be in time. // *************************************************** int HowFarBack=StartingBarsTime-TimeToLookFor; // *************************************************** // Translate that into Bars // *************************************************** int HowManyBarsBack=HowFarBack/Period(); // *************************************************** // We've found our starting point // Calculate it's relative time in minutes. // *************************************************** int SuggestedBar=StartingBar+HowManyBarsBack; int SuggestedBarsTime=(TimeHour(Time[SuggestedBar])*60)+TimeMinute(Time[SuggestedBar]); // *************************************************** // If we have what we're after let's just skip the // crap and return the position of the bar in the // chart to our main routine // *************************************************** if (SuggestedBarsTime==TimeToLookFor) { return(SuggestedBar); } // *************************************************** // Else find the difference in time from where we // were supposed to find the bar. // *************************************************** int DeltaTimeFound=TimeToLookFor-SuggestedBarsTime; int DeltaBarFound=DeltaTimeFound/Period(); // *************************************************** // I'd be worried if Delta was below zero. Would mean // that we have EXTRA bars in that day. Unlikely in // the extreme. // So I'm only checking for the other case. // ...now let's search in a narrow range to find that // bar we are after... // *************************************************** if (DeltaTimeFound>0) { for (int SearchCount=SuggestedBar ;SearchCount>(SuggestedBar-DeltaBarFound-2) ;SearchCount--) { // ****************************************************************************** // Find time (in minutes) of the current bar AND the two bars either side of it. // This is done to allow for any missing bars in the data. i.e. If THE bar you // were after were to be missing you'd never get a valid close/open time. // This is the same reason for searching rather than just looking back a certain // number of bars from the close time. Missing bars upset the count back and // screw up all pivot calculations. There is still room for error but it's improved. // The best calculations will come from having the best data. ...of course. :) // ****************************************************************************** // int PreviousBarsTime=(TimeHour(Time[SearchCount+1])*60)+TimeMinute(Time[SearchCount+1]); int CurrentBarsTime=(TimeHour(Time[SearchCount])*60)+TimeMinute(Time[SearchCount]); int NextBarsTime=(TimeHour(Time[SearchCount-1])*60)+TimeMinute(Time[SearchCount-1]); if (CurrentBarsTime==TimeToLookFor) { return(SearchCount); // *** If current bar is what we are after than lets get out. // *** without mucking about with the rest of the checks. } // ********************************** // Check that previous bar doesn't // lay on a different day. // Adjust if it is // ********************************** if(PreviousBarsTime>CurrentBarsTime) { PreviousBarsTime=PreviousBarsTime-1440; } // ********************************** // Check that following bar doesn't // lay on a different day. // Adjust if it is. // ********************************** if(NextBarsTime<CurrentBarsTime) { NextBarsTime=NextBarsTime+1440; } // ****************************************** // If this is the best we can get // to the actual bar we are after, then // exit, returning current bar number. // ******************************************* if(PreviousBarsTime<TimeToLookFor) { if( TimeToLookFor<NextBarsTime) { return(SearchCount); } } } } return (SuggestedBar); }
Indicatore MetaTrader //+------------------------------------------------------------------+ //| AutoDayFibs V1.0 | //| | //| Copyright © 2005, Jason Robinson | //| (jasonrobinsonuk, jnrtrading) | //| http://www.jnrtrading.co.uk | //| | //| Created by jnrtrading | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Jason Robinson (jnrtrading)" #property link "http://www.jnrtrading.co.uk" #property indicator_chart_window extern int daysBackForHigh = 1; extern int daysBackForLow = 1; //---- buffers double Rates[][6]; double fib000, fib236, fib382, fib50, fib618, fib100, fib1618, fib2618, fib4236, range, prevRange, high, low; bool objectsExist, highFirst; prevRange = 0; objectsExist = false; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //prevRange = 0; //objectsExist = false; //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete("fib000"); ObjectDelete("fib000_label"); ObjectDelete("fib236"); ObjectDelete("fib236_label"); ObjectDelete("fib382"); ObjectDelete("fib382_label"); ObjectDelete("fib50"); ObjectDelete("fib50_label"); ObjectDelete("fib618"); ObjectDelete("fib618_label"); ObjectDelete("fib100"); ObjectDelete("fib100_label"); ObjectDelete("fib1618"); ObjectDelete("fib1618_label"); ObjectDelete("fib2618"); ObjectDelete("fib2618_label"); ObjectDelete("fib4236"); ObjectDelete("fib4236_label"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i = 0; //---- //Print(prevRange); ArrayCopyRates(Rates, Symbol(), PERIOD_D1); high = Rates[daysBackForHigh][3]; low = Rates[daysBackForLow][2]; range = high - low; while(true) { if(High[i] == high) { highFirst = true; break; } else if(Low[i] == low) { highFirst = false; break; } i++; } //Print(highFirst); // Delete Objects if necessary if (prevRange != range) { ObjectDelete("fib000"); ObjectDelete("fib000_label"); ObjectDelete("fib236"); ObjectDelete("fib236_label"); ObjectDelete("fib382"); ObjectDelete("fib382_label"); ObjectDelete("fib50"); ObjectDelete("fib50_label"); ObjectDelete("fib618"); ObjectDelete("fib618_label"); ObjectDelete("fib100"); ObjectDelete("fib100_label"); ObjectDelete("fib1618"); ObjectDelete("fib1618_label"); ObjectDelete("fib2618"); ObjectDelete("fib2618_label"); ObjectDelete("fib4236"); ObjectDelete("fib4236_label"); objectsExist = false; prevRange = range; //Print("Objects do not exist"); } if (highFirst == true) { fib000 = low; fib236 = (range * 0.236) + low; fib382 = (range * 0.382) + low; fib50 = (high + low) / 2; fib618 = (range * 0.618) + low; fib100 = high; fib1618 = (range * 0.618) + high; fib2618 = (range * 0.618) + (high + range); fib4236 = (range * 0.236) + high + (range * 3); } else if (highFirst == false) { fib000 = high; fib236 = high - (range * 0.236); fib382 = high - (range * 0.382); fib50 = (high + low) / 2; fib618 = high - (range * 0.618); fib100 = low; fib1618 = low - (range * 0.618); fib2618 = (low - range) - (range * 0.618);// + (high + range); fib4236 = low - (range * 3) - (range * 0.236);// + high + (range * 3); } if (objectsExist == false) { ObjectCreate("fib000", OBJ_HLINE, 0, Time[40], fib000); ObjectSet("fib000", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib000", OBJPROP_COLOR, Orange); ObjectCreate("fib000_label", OBJ_TEXT, 0, Time[0], fib000); ObjectSetText("fib000_label"," 0.0", 8, "Times", Black); ObjectCreate("fib236", OBJ_HLINE, 0, Time[40], fib236); ObjectSet("fib236", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib236", OBJPROP_COLOR, Orange); ObjectCreate("fib236_label", OBJ_TEXT, 0, Time[0], fib236); ObjectSetText("fib236_label"," 23.6", 8, "Times", Black); ObjectCreate("fib382", OBJ_HLINE, 0, Time[40], fib382); ObjectSet("fib382", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib382", OBJPROP_COLOR, Orange); ObjectCreate("fib382_label", OBJ_TEXT, 0, Time[0], fib382); ObjectSetText("fib382_label"," 38.2", 8, "Times", Black); ObjectCreate("fib50", OBJ_HLINE, 0, Time[40], fib50); ObjectSet("fib50", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib50", OBJPROP_COLOR, Orange); ObjectCreate("fib50_label", OBJ_TEXT, 0, Time[0], fib50); ObjectSetText("fib50_label"," 50.0", 8, "Times", Black); ObjectCreate("fib618", OBJ_HLINE, 0, Time[40], fib618); ObjectSet("fib618", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib618", OBJPROP_COLOR, Orange); ObjectCreate("fib618_label", OBJ_TEXT, 0, Time[0], fib618); ObjectSetText("fib618_label"," 61.8", 8, "Times", Black); ObjectCreate("fib100", OBJ_HLINE, 0, Time[40], fib100); ObjectSet("fib100", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib100", OBJPROP_COLOR, Orange); ObjectCreate("fib100_label", OBJ_TEXT, 0, Time[0], fib100); ObjectSetText("fib100_label"," 100.0", 8, "Times", Black); ObjectCreate("fib1618", OBJ_HLINE, 0, Time[40], fib1618); ObjectSet("fib1618", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib1618", OBJPROP_COLOR, Orange); ObjectCreate("fib1618_label", OBJ_TEXT, 0, Time[0], fib1618); ObjectSetText("fib1618_label"," 161.8", 8, "Times", Black); ObjectCreate("fib2618", OBJ_HLINE, 0, Time[40], fib2618); ObjectSet("fib2618", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib2618", OBJPROP_COLOR, Orange); ObjectCreate("fib2618_label", OBJ_TEXT, 0, Time[0], fib2618); ObjectSetText("fib2618_label"," 261.8", 8, "Times", Black); ObjectCreate("fib4236", OBJ_HLINE, 0, Time[40], fib4236); ObjectSet("fib4236", OBJPROP_STYLE, STYLE_DASHDOTDOT); ObjectSet("fib4236", OBJPROP_COLOR, Orange); ObjectCreate("fib4236_label", OBJ_TEXT, 0, Time[0], fib4236); ObjectSetText("fib4236_label"," 423.6", 8, "Times", Black); //Print("Objects Exist"); } //---- 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 "