Algorithms

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
How to install
DescriptionSubmited byDateCategoryPreviewDownloadsCommentsRating
This indicator is a great tool for short term day traders those who trade Time frames below M15, It shows some useful information about that symbol on it's chart. Symbol Info display ATR value in pips(You can use the multiplier to multiply ATR value), daily High / Low lines, real time spread, ADR or average daily range, Current day range, amount of space in pips that particular pair can go up / down on that day based on ADR and the longer time frame trend direction by using a moving average. You can adjust the color of Up / Down space by setting your Risk / Reward if you are using ATR value as your trades stop loss.  Download : https://www.algodeveloper.com/7-symbol-info
07 Dec 2016
Downloads
511
Comments
2
Rating
0
Download
This indicator catches the reversals by using Bollinger bands and rejection candle, Whenever price touches one of the bands and form a rejection candle it shows a buy or sell signal.   Download Demo / Buy: http://algodeveloper.com/4-reversal-magic  
07 Dec 2016
Downloads
680
Comments
0
Rating
0
Download
this is a test
06 Dec 2016
Downloads
74
Comments
1
Rating
0
Download
this is a test
06 Dec 2016
Downloads
80
Comments
0
Rating
0
Download
Code desined to help Trader easy to treder with EMA - STO - RSI - DMI index in 1 code. Red Point for STO Index, Yellow Point for EMA Index, Purple Point for RSI Index, DMI Point for DMI Index. Include Open Week Price line and Open Month Price Line. using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class WeeklyTradingSignal : Indicator { //EMASignal [Parameter("LongEMA", DefaultValue = 100)] public int LongEMA { get; set; } [Parameter("ShortEMA", DefaultValue = 5)] public int ShortEMA { get; set; } //ADXSignal [Parameter("ADXPeriod", DefaultValue = 10)] public int ADXPeriod { get; set; } //RSISignal [Parameter("RSIPeriod", DefaultValue = 14)] public int RSIPeriod { get; set; } //STOSignal [Parameter("STOKValue", DefaultValue = 9)] public int STOKValue { get; set; } [Parameter("STODValue", DefaultValue = 3)] public int STODValue { get; set; } [Parameter("STOSlow", DefaultValue = 2)] public int STOSlow { get; set; } [Output("ADX Point", Color = Colors.White, PlotType = PlotType.Points, Thickness = 5)] public IndicatorDataSeries ADXPoint { get; set; } [Output("EMA point", Color = Colors.Yellow, PlotType = PlotType.Points, Thickness = 5)] public IndicatorDataSeries EMAPoint { get; set; } [Output("RSI Down Point", Color = Colors.Purple, PlotType = PlotType.Points, Thickness = 5)] public IndicatorDataSeries RSIPoint { get; set; } [Output("STO Point", Color = Colors.Red, PlotType = PlotType.Points, Thickness = 5)] public IndicatorDataSeries STOPoint { get; set; } private ExponentialMovingAverage EMAs, EMAl; private RelativeStrengthIndex rsi; private MarketSeries DailySource, WeeklySource, MonthlySource; private DirectionalMovementSystem ADX; private ExponentialMovingAverage ema10; private ExponentialMovingAverage ema20; private ExponentialMovingAverage ema50; private ExponentialMovingAverage ema200; private StochasticOscillator STO; protected override void Initialize() { DailySource = MarketData.GetSeries(TimeFrame.Daily); WeeklySource = MarketData.GetSeries(TimeFrame.Weekly); MonthlySource = MarketData.GetSeries(TimeFrame.Monthly); ADX = Indicators.DirectionalMovementSystem(ADXPeriod); rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, RSIPeriod); EMAs = Indicators.ExponentialMovingAverage(MarketSeries.Close, ShortEMA); EMAl = Indicators.ExponentialMovingAverage(MarketSeries.Close, LongEMA); ema10 = Indicators.ExponentialMovingAverage(DailySource.Close, 10); ema20 = Indicators.ExponentialMovingAverage(DailySource.Close, 20); ema50 = Indicators.ExponentialMovingAverage(DailySource.Close, 50); ema200 = Indicators.ExponentialMovingAverage(DailySource.Close, 200); STO = Indicators.StochasticOscillator(STOKValue, STOSlow, STODValue, MovingAverageType.Exponential); } public int CandleTick() { int results = -1; double OpenClose = MarketSeries.Close.Last(0) - MarketSeries.Open.Last(0); double HighLow = MarketSeries.High.Last(0) - MarketSeries.High.Last(0); double Open = MarketSeries.Open.Last(0); double Close = MarketSeries.Close.Last(0); double Median = MarketSeries.Median.Last(0); if ((OpenClose < HighLow / 3 && Open > Median && Close > Median) || (OpenClose > 0.7 * HighLow)) results = 0; else if ((OpenClose < HighLow / 3 && Open < Median && Close < Median) || (OpenClose > 0.7 * HighLow)) results = 1; return results; } public override void Calculate(int index) { //LongTrendSignal var StaticLongPos = StaticPosition.BottomLeft; string name = "Xu hướng dài hạn"; string LongResults; string DayOfWeek = DailySource.OpenTime.Last(0).DayOfWeek.ToString(); if (ema10.Result.Last(1) > ema20.Result.Last(1) && ema20.Result.Last(1) > ema50.Result.Last(1) && ema50.Result.Last(1) > ema200.Result.Last(1)) LongResults = "Long: Up"; else if (ema10.Result.Last(1) < ema20.Result.Last(1) && ema20.Result.Last(1) < ema50.Result.Last(1) && ema50.Result.Last(1) < ema200.Result.Last(1)) LongResults = "Long: Down"; else LongResults = "Long: Unknow"; //if (LongResults == "Long: Up" && ema10.Result.IsRising() && ema10.Result.Last(0) < MarketSeries.Low.Last(0)) //LongPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 25); //else if (LongResults == "Long: Down" && ema10.Result.IsFalling() && ema10.Result.Last(0) > MarketSeries.High.Last(0)) //LongPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 25); //End //EMASignal string TF = TimeFrame.ToString(); int CandleSignal = CandleTick(); double EMA0 = EMAs.Result.Last(0) - EMAl.Result.Last(0); double EMA1 = EMAs.Result.Last(1) - EMAl.Result.Last(1); double EMA2 = EMAs.Result.Last(2) - EMAl.Result.Last(2); double EMA3 = EMAs.Result.Last(3) - EMAl.Result.Last(3); double EMA4 = EMAs.Result.Last(4) - EMAl.Result.Last(4); double EMA5 = EMAs.Result.Last(5) - EMAl.Result.Last(5); double EMA6 = EMAs.Result.Last(6) - EMAl.Result.Last(6); double EMA7 = EMAs.Result.Last(7) - EMAl.Result.Last(7); double AvgEMA0 = (EMA0 + EMA1 + EMA2) / 3; double AvgEMA1 = (EMA1 + EMA2 + EMA3) / 3; double AvgEMA2 = (EMA2 + EMA3 + EMA4) / 3; double AvgEMA3 = (EMA5 + EMA3 + EMA4) / 3; double DelEMA0 = EMA0 - AvgEMA0; double DelEMA1 = EMA1 - AvgEMA1; double DelEMA2 = EMA2 - AvgEMA2; double DelEMA3 = EMA3 - AvgEMA3; double EmaMin5 = EMAs.Result.Minimum(10); double EmaMax5 = EMAs.Result.Maximum(10); //Trường hợp cắt trên và dưới //if (EMA0 > AvgEMA0 && EMA1 < AvgEMA1 && EMA2 < AvgEMA2) //EMAPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 10); //else if (EMA0 < AvgEMA0 && EMA1 > AvgEMA1 && EMA2 > AvgEMA2) //EMAPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 10); // Trường hợp tạo đỉnh và đáy if (EMA0 > AvgEMA0 && EMA1 < AvgEMA1 && EMA0 > EMA1 && EMA1 <= EMA2 && EMA2 <= EMA3) //&& EMA3 <= EMA4) // && CandleSignal == 0) EMAPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 10); else if (EMA0 < AvgEMA0 && EMA1 > AvgEMA1 && EMA0 < EMA1 && EMA1 >= EMA2 && EMA2 >= EMA3) // && EMA3 >= EMA4) //&& CandleSignal == 1) EMAPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 10); //End //RSISignal double RSIvalue0 = rsi.Result.Last(0); double RSIvalue1 = rsi.Result.Last(1); double RSIvalue2 = rsi.Result.Last(2); double RSIvalue3 = rsi.Result.Last(3); double RSIMin120 = rsi.Result.Minimum(120); double RSIMax120 = rsi.Result.Maximum(120); string RsiResults; if ((rsi.Result.HasCrossedAbove(30, 0) && RSIvalue1 < 30 && RSIvalue2 < 30 && RSIvalue3 < 30)) //(RSIMin120 >= RSIvalue1 && RSIvalue0 >= RSIvalue1 && RSIvalue1 < RSIvalue2 && RSIvalue2 < RSIvalue3) || RSIPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 20); else if ((rsi.Result.HasCrossedBelow(70, 0) && RSIvalue1 > 70 && RSIvalue2 > 70 && RSIvalue3 > 70)) //(RSIMax120 <= RSIvalue1 && RSIvalue0 <= RSIvalue1 && RSIvalue1 > RSIvalue2 && RSIvalue2 > RSIvalue3) || RSIPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 20); if (29 <= rsi.Result.Last(0) && rsi.Result.Last(0) < 30 && RSIvalue1 < 30 && RSIvalue2 < 30 && RSIvalue3 < 30) RsiResults = "RSI: Sell Signal Nearly Appear"; else if (70 < rsi.Result.Last(0) && rsi.Result.Last(0) <= 71 && RSIvalue1 > 70 && RSIvalue2 > 70 && RSIvalue3 > 70) RsiResults = "RSI: Buy Signal Nearly Appear"; else RsiResults = ""; //End //ADXSignal double DIMinus1 = ADX.DIMinus.Last(1); double DIMinus2 = ADX.DIMinus.Last(2); double DIMinus3 = ADX.DIMinus.Last(3); double DIPlus1 = ADX.DIPlus.Last(1); double DIPlus2 = ADX.DIPlus.Last(2); double DIPlus3 = ADX.DIPlus.Last(3); string AdxResults; if (ADX.DIPlus.HasCrossedAbove(ADX.DIMinus, 0) && DIPlus1 < DIMinus1 && DIPlus2 < DIMinus2 && DIPlus3 < DIMinus3) ADXPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 30); else if (ADX.DIPlus.HasCrossedBelow(ADX.DIMinus, 0) && DIPlus1 > DIMinus1 && DIPlus2 > DIMinus2 && DIPlus3 > DIMinus3) ADXPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 30); if (Math.Abs(ADX.DIPlus.Last(0) - ADX.DIMinus.Last(0)) <= 1 && ADX.DIPlus.Last(0) > ADX.DIMinus.Last(0) && DIPlus1 < DIMinus1 && DIPlus2 < DIMinus2 && DIPlus3 < DIMinus3) AdxResults = "ADX: Sell Signal Nearly Appear"; else if (Math.Abs(ADX.DIPlus.Last(0) - ADX.DIMinus.Last(0)) <= 1 && ADX.DIPlus.Last(0) < ADX.DIMinus.Last(0) && DIPlus1 > DIMinus1 && DIPlus2 > DIMinus2 && DIPlus3 > DIMinus3) AdxResults = "ADX: Buy Signal Nearly Appear"; else AdxResults = ""; //End //StoSignal double KValue0 = STO.PercentK.Last(0); double KValue1 = STO.PercentK.Last(1); double KValue2 = STO.PercentK.Last(2); double KValue3 = STO.PercentK.Last(3); double KValue4 = STO.PercentK.Last(4); double KValue5 = STO.PercentK.Last(5); double KValue6 = STO.PercentK.Last(6); double DValue0 = STO.PercentD.Last(0); double DValue1 = STO.PercentD.Last(1); double DValue2 = STO.PercentD.Last(2); double DValue3 = STO.PercentD.Last(3); //Trường hợp giao nhau //if (STO.PercentK.HasCrossedAbove(STO.PercentD, 0) && KValue1 < DValue1 && KValue2 < DValue2 && KValue3 < DValue3) //STOPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 40); //else if (STO.PercentK.HasCrossedBelow(STO.PercentD, 0) && KValue1 > DValue1 && KValue2 > DValue2 && KValue3 > DValue3) //STOPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 40); //Trường hợp đỉnh đáy if (KValue0 > DValue0 && KValue0 > KValue1 && KValue1 < KValue2 && KValue2 < KValue3 && KValue3 < KValue4) //&& KValue4 < KValue5 && KValue5 < KValue6) STOPoint[index] = MarketSeries.Low[index] - (Symbol.PipSize * 40); else if (KValue0 < DValue0 && KValue0 < KValue1 && KValue1 > KValue2 && KValue2 > KValue3 && KValue3 > KValue4) //&& KValue4 > KValue5 && KValue5 > KValue6) STOPoint[index] = MarketSeries.High[index] + (Symbol.PipSize * 40); //End //OpenWeek for (int i = 0; i < 120; i++) { DateTime startOfMonth = MonthlySource.OpenTime.Last(i).Date.AddDays(0); DateTime endOfMonth = startOfMonth.AddMonths(1); DateTime StartOfWeek = WeeklySource.OpenTime.Last(i).Date.AddDays(0); DateTime endOfWeek = StartOfWeek.AddDays(7); DateTime StartOfDay = DailySource.OpenTime.Last(i).Date.AddDays(0); DateTime endOfDay = StartOfDay.AddHours(24); var MonthlyOpen = MonthlySource.Open.Last(i); var WeeklyOpen = WeeklySource.Open.Last(i); var DailyOpen = DailySource.Open.Last(i); ChartObjects.DrawLine("OpenWeek" + i, StartOfWeek, WeeklyOpen, endOfWeek, WeeklyOpen, Colors.Aqua, 1); ChartObjects.DrawLine("OpenMonth" + i, startOfMonth, MonthlyOpen, endOfMonth, MonthlyOpen, Colors.SlateGray, 2); } //End ChartObjects.DrawText(name, LongResults + "\n" + RsiResults + "\n" + AdxResults, StaticLongPos, Colors.Red); } } }  
29 Nov 2016
Downloads
212
Comments
0
Rating
5
Download
Using Forex Zone cBot, you can share your trades with your friends and follower or any forex trader in Forex Zone network. So, When you are making good profit, you also can help others to do same :D , Also if you want you can sell your signals there. Get API Key from here: https://fxzone.net/edit-profile/ Download Full Version: https://fxzone.net/download/forex-zone-cbot/ New Rlease: v1.0.1 / Nov 24. 2016 As you know cTrader doesn't show user sentiments for some assets like indices, now you can see Forex Zone user sentiments when using this cBot, which could be helpfull for your trading decision. ** More features are coming soon. Also you can tell me if you have any new idea to add here :)
28 Nov 2016
Downloads
168
Comments
0
Rating
0
Download
My Fellow traders, both amateurs and professional ones. I fully understand that you are TRADERS and as such, you are by no mean required to be a magician with the ability to manipulate small or huge amounts of data. I understand that many times, you are overwhelmed by questions like, what was my profit during this and that period, how many orders did put in, how many pips did I gain or lose, and much much more.   As a Live FX trader myself, I have often used other websites for preparing statistics of my Demo accounts, but for my live account and strategy, I decided this was not an option anymore.   I am a fairly good user of Excel and let's say that Pivot Tables are one of my favourite tools for the data analysis, but many times what I just needed was a quick glance straight on cTrader or Calgo.   Therefore, I created my "History Dashboard" cbot, which does what I needed it to give me a glance on my trading history. It tells me about a specific period, about my specific pairs, my specific label, how many sell/buy/total orders I had, net profit, pips gained and I can leave it running so it will refresh anytime a new order is closed. I believe you already have a high-resolution screen, as the information can be a lot.           Please drop me an email, or use the contact page from my blog, if you are interested into embedding more pairs into the cbot. Hope you will enjoy and use this cbot   Oltion Bregu https://www.bregu.al        
21 Nov 2016
Downloads
87
Comments
0
Rating
0
Download
This cBot provides signals to pause your robots (x) minutes before, during and after a news release. If you automate your trading using technical indicators the
21 Nov 2016
Downloads
78
Comments
0
Rating
0
Download
This cBot provides signals to pause your robots (x) minutes before, during and after a news release. If you automate your trading using technical indicators then this may fail during a major news release on intra-day, if you are looking long term then the price may recover and continue its trend, if you do not mind the draw-down.   I have modified the robot so that it now manages news releases for all currencies that you list as a comma delimiting string in the user defined parameters. You can now also specify the date format for the CSV file from my-FxBook. If your automated strategy is based on technical indicators then you are gambling during major news releases, if your robot is based on high volatility during a news release then you do not need this robot. I found that by using this robot I avoided large draw-downs in my strategy over time due to unpredictable price movement, unfortunately you cannot back-test this type of anomaly on this platform. Here is an example on a 15 minute chart, if the technical indicators would have signaled long it would have blown my stops, but luckily I had sell signals, but this also would have caused me problems as my robots would still be signalling a sell and opened a new short position at the bottom of the spike. By avoiding a major news release you bypass all the price spikes. To get it to work you simply download the news file from MyFxBook in CSV format. http://www.myfxbook.com/forex-economic-calendar You can download the CSV file from the more tab as shown below:   CURRENCY PAIRS The news release manage will email you whenever an event is about to happen for a particular currency, but the robot will only manage the currency list you specify in the user settings. Download the news file to any folder you want, I put mine in the cAlgo folder called news files, you can set the path in the cBot as shown below, I download 1 week ahead every Sunday, but you can do monthly too. You can set the robot to signal (x) minutes before a news release and (x) minutes after, I usually do not start trading again until 3-6 hours after a major news release. You can turn on email notifications which will inform you a news release is about to happen and when it is over and your robots have started trading again.   Email Message Example You can pause all robot instances before a news release or just those that the news release related to, so a United States news release will affect all currency pairs with USD or Indices that are US, to make sure the news files have loaded correctly, just run the robot and in the log file you will see the following: The robot checks the news file every minute. WHAT DOES IT DO? All the news manager robot achieves is to add an entry into the windows registry for a client application to read and decide to trade or not. I could have stored the signal's anywhere, file-system, database etc.   All you need to do to make this work with a cBot is to read the registry key and if it is true pause your robot. Phone: 0044 20 3289 6573 * All international calls are local rates (low cost) www.ClickAlgo.com Creative Trading with Technology          
19 Nov 2016
Downloads
899
Comments
13
Rating
5
Download
         using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class CCIReversal : Robot { [Parameter(DefaultValue = 26)] public int cciPeriod { get; set; } [Parameter(DefaultValue = 9)] public int maPeriod { get; set; } [Parameter("Quantity (Lots)", DefaultValue = 1, MinValue = 0.01, Step = 0.01)] public double Quantity { get; set; } private CommodityChannelIndex cci; //private Position _position; private const string robotname = "CCIReversal"; protected override void OnStart() { cci = Indicators.CommodityChannelIndex(cciPeriod); } protected override void OnBar() { var longPos = Positions.Find(robotname, Symbol, TradeType.Buy); var shortPos = Positions.Find(robotname, Symbol, TradeType.Sell); var pre_cci = cci.Result.Last(2); var cur_cci = cci.Result.Last(0); bool LongPosition = _position != null && _position.TradeType == TradeType.Buy; bool ShortPosition = _position != null && _position.TradeType == TradeType.Sell; Print("CCI = " + cur_cci + " Pre CCI" + pre_cci); if ((cci.Result.HasCrossedAbove(-100.0, 1) && cur_cci > pre_cci) || (cci.Result.HasCrossedAbove(100.0, 1) && cur_cci > pre_cci)) { if (shortPos != null) { ClosePosition(shortPos); ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, robotname); } else if (longPos == null) { ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, robotname); } else { ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, robotname); } Print("con1"); } else if ((cci.Result.HasCrossedBelow(-100.0, 1) && cur_cci < pre_cci) || (cci.Result.HasCrossedBelow(100, 1) && cur_cci < pre_cci)) { if (longPos != null) { ClosePosition(longPos); ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, robotname); } else if (shortPos == null) { ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, robotname); } else { ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, robotname); } Print("con2"); } Print("Long" + (longPos != null)); Print("Short" + (shortPos != null)); } private long VolumeInUnits { get { return Symbol.QuantityToVolume(Quantity); } } } /* private void Close(TradeType tradeType) { foreach (var position in Positions.FindAll(robotname, Symbol, tradeType)) ClosePosition(_position); } private void Open(TradeType tradeType) { _position = Positions.Find(robotname, Symbol, tradeType); var volumeInUnits = Symbol.QuantityToVolume(Quantity); if (_position == null) ExecuteMarketOrder(tradeType, Symbol, volumeInUnits, robotname); }*/ }    Backtest on Silver The CCI Reversal Buy when CCI(26) Cross above -100 or 100(when no buy position open), in the case of crossing above -100 the cbot will be selling when CCI(26) cross below 0, but if the CCI(26) reach over 100 it will be selling when CCI(26) cross below 100 .  In case of short position, it's the reversal of buy position. There is parameter name 'MA' but notthing importance for now, I added it for the next version.  and the parameter Trading Size, value 2 mean trade both side long and short, 0 = trade on short side only, 1 = trade on long side only.  If you find any mistake of this algorithm please let me know.
16 Nov 2016
Downloads
195
Comments
0
Rating
0
Download
using System; using cAlgo.API; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, AccessRights = AccessRights.None)] public class PivotPointsIntraDay : Indicator { private double _close; private double _higher; private double _lower; #region Output [Output("Pivot", LineStyle = LineStyle.Lines)] public IndicatorDataSeries Pivot { get; set; } [Output("R1", LineStyle = LineStyle.Lines, Color = Colors.Blue)] public IndicatorDataSeries R1 { get; set; } [Output("R2", LineStyle = LineStyle.Lines, Color = Colors.Blue)] public IndicatorDataSeries R2 { get; set; } [Output("R3", LineStyle = LineStyle.Lines, Color = Colors.Blue)] public IndicatorDataSeries R3 { get; set; } [Output("S1", LineStyle = LineStyle.Lines, Color = Colors.Red)] public IndicatorDataSeries S1 { get; set; } [Output("S2", LineStyle = LineStyle.Lines, Color = Colors.Red)] public IndicatorDataSeries S2 { get; set; } [Output("S3", PlotType = PlotType.Line, LineStyle = LineStyle.Lines, Color = Colors.Red)] public IndicatorDataSeries S3 { get; set; } #endregion #region Input Parameters [Parameter("Number of Pivots", DefaultValue = 3, MinValue = 1, MaxValue = 3)] public int NoPiv { get; set; } [Parameter("DrawingWidth", DefaultValue = 50, MaxValue = 100)] public int DrawingWidth { get; set; } #endregion public override void Calculate(int index) { DateTime currentOpenTime = MarketSeries.OpenTime[index]; DateTime previousOpenTime = MarketSeries.OpenTime[index - 1]; DateTime today = DateTime.Now; DateTime yesterday = DateTime.Now.AddDays(-1); // Initialize High & Low if (currentOpenTime.Day == yesterday.Day && previousOpenTime.Day != yesterday.Day) { _higher = MarketSeries.High[index]; _lower = MarketSeries.Low[index]; } // Calculate High & Low of previous day if ((currentOpenTime.Day == yesterday.Day && today.DayOfWeek != DayOfWeek.Monday) || (today.DayOfWeek == DayOfWeek.Monday && currentOpenTime.DayOfYear == today.AddDays(-3).Day)) { if (MarketSeries.High[index] > _higher) { _higher = MarketSeries.High[index]; } if (MarketSeries.Low[index] < _lower) { _lower = MarketSeries.Low[index]; } } // Set Close of previous day - Close of Last Bar of prevous Day if (previousOpenTime.Day == yesterday.Day && currentOpenTime.Day == today.Day) { _close = MarketSeries.Close[index - 1]; } // Only show output in todays timeframe if (currentOpenTime.Date != today.Date) return; // Calculate output Pivot[index] = (_higher + _lower + _close)/3; R1[index] = 2*Pivot[index] - _lower; S1[index] = 2*Pivot[index] - _higher; // Display additional pivots according to input if (NoPiv >= 2) { R2[index] = Pivot[index] + (_higher - _lower); S2[index] = Pivot[index] - (_higher - _lower); } if (NoPiv >= 3) { R3[index] = _higher + 2*(Pivot[index] - _lower); S3[index] = _lower - 2*(_higher - Pivot[index]); } } } }  
12 Nov 2016
Downloads
536
Comments
0
Rating
0
Download
fgfgfgfggfgfgfgfggfgfgfgfgfgfggddgdgdgdysdfyfysdofyfyouoyfuiafosdfyouayuiydsoiufysduyfosauiyosiafyfusoasgdfgdfgdfgdgdfgdgdggddgdggdgdgdgdfg dggdfgdfgdfgg fdgdfgdgdgg dggdgdgdfgdfgg gddgdgggdgdgdf ffsdfsff sfsfsfvgsvhfsgcghsghgdshgd  g hsghghsghgdhsgd ghgshghgdshdsg ghgshdghgdshs ghsghgshgsh ghsghghsghsfgfgfgfggfgfgfgfggfgfgfgfgfgfggddgdgdgdysdfyfysdofyfyouoyfuiafosdfyouayuiydsoiufysduyfosauiyosiafyfusoasgdfgdfgdfgdgdfgdgdggddgdggdgdgdgdfg dggdfgdfgdfgg fdgdfgdgdgg dggdgdgdfgdfgg gddgdgggdgdgdf ffsdfsff sfsfsfvgsvhfsgcghsghgdshgd  g hsghghsghgdhsgd ghgshghgdshdsg ghgshdghgdshs ghsghgshgsh ghsghghsghsfgfgfgfggfgfgfgfggfgfgfgfgfgfggddgdgdgdysdfyfysdofyfyouoyfuiafosdfyouayuiydsoiufysduyfosauiyosiafyfusoasgdfgdfgdfgdgdfgdgdggddgdggdgdgdgdfg dggdfgdfgdfgg fdgdfgdgdgg dggdgdgdfgdfgg gddgdgggdgdgdf ffsdfsff sfsfsfvgsvhfsgcghsghgdshgd  g hsghghsghgdhsgd ghgshghgdshdsg ghgshdghgdshs ghsghgshgsh ghsghghsghsfgfgfgfggfgfgfgfggfgfgfgfgfgfggddgdgdgdysdfyfysdofyfyouoyfuiafosdfyouayuiydsoiufysduyfosauiyosiafyfusoasgdfgdfgdfgdgdfgdgdggddgdggdgdgdgdfg dggdfgdfgdfgg fdgdfgdgdgg dggdgdgdfgdfgg gddgdgggdgdgdf ffsdfsff sfsfsfvgsvhfsgcghsghgdshgd  g hsghghsghgdhsgd ghgshghgdshdsg ghgshdghgdshs ghsghgshgsh ghsghghsghsfgfgfgfggfgfgfgfggfgfgfgfgfgfggddgdgdgdysdfyfysdofyfyouoyfuiafosdfyouayuiydsoiufysduyfosauiyosiafyfusoasgdfgdfgdfgdgdfgdgdggddgdggdgdgdgdfg dggdfgdfgdfgg fdgdfgdgdgg dggdgdgdfgdfgg gddgdgggdgdgdf ffsdfsff sfsfsfvgsvhfsgcghsghgdshgd  g hsghghsghgdhsgd ghgshghgdshdsg ghgshdghgdshs ghsghgshgsh ghsghghsghs
06 Nov 2016
Downloads
112
Comments
0
Rating
0
Download