NoNo Indicator by Popov

46972 downloads / 4569 views / Created: 25.09.2013
 Average Rating: 5

Indicator Description

This indicator doesn't rises signals.
It is useful when you want to prevent entry or exit signals.
The indicator is marked with: IsGeneratable = false;

Comments

//============================================================== // Forex Strategy Builder // Copyright © Miroslav Popov. All rights reserved. //============================================================== // THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE. //============================================================== using System; using System.Drawing; using ForexStrategyBuilder.Infrastructure.Entities; using ForexStrategyBuilder.Infrastructure.Enums; using ForexStrategyBuilder.Infrastructure.Interfaces; namespace ForexStrategyBuilder.Indicators.Store { public class NoNoIndicator : Indicator { public NoNoIndicator() { IndicatorName = "NoNo Indicator"; PossibleSlots = SlotTypes.Open | SlotTypes.OpenFilter | SlotTypes.Close | SlotTypes.CloseFilter; IsGeneratable = false; IndicatorAuthor = "Miroslav Popov"; IndicatorVersion = "1.0"; IndicatorDescription = "The indicator doesn't rise signals."; } public override void Initialize(SlotTypes slotType) { SlotType = slotType; // ComboBox parameters IndParam.ListParam[0].Caption = "Logic"; if (SlotType == SlotTypes.Open) IndParam.ListParam[0].ItemList = new string[] { "No entry" }; else if (SlotType == SlotTypes.OpenFilter) IndParam.ListParam[0].ItemList = new string[] { "No signal" }; else if (SlotType == SlotTypes.Close) IndParam.ListParam[0].ItemList = new string[] { "No exit" }; else if (SlotType == SlotTypes.CloseFilter) IndParam.ListParam[0].ItemList = new string[] { "No signal" }; else IndParam.ListParam[0].ItemList = new string[] { "Not Defined" }; IndParam.ListParam[0].Index = 0; IndParam.ListParam[0].Text = IndParam.ListParam[0].ItemList[IndParam.ListParam[0].Index]; IndParam.ListParam[0].Enabled = true; IndParam.ListParam[0].ToolTip = "Logic of rule."; } public override void Calculate(IDataSet dataSet) { DataSet = dataSet; // Saving the components Component = new IndicatorComp[2]; Component[0] = new IndicatorComp(); Component[0].ChartType = IndChartType.NoChart; Component[0].FirstBar = 0; Component[0].Value = new double[Bars]; Component[1] = new IndicatorComp(); Component[1].ChartType = IndChartType.NoChart; Component[1].FirstBar = 0; Component[1].Value = new double[Bars]; // Sets the Component's type. if (SlotType == SlotTypes.Open) { Component[0].DataType = IndComponentType.OpenLongPrice; Component[0].CompName = "Long position entry price"; Component[1].DataType = IndComponentType.OpenShortPrice; Component[1].CompName = "Short position entry price"; } else if (SlotType == SlotTypes.OpenFilter) { Component[0].DataType = IndComponentType.AllowOpenLong; Component[0].CompName = "Is long entry allowed"; Component[1].DataType = IndComponentType.AllowOpenShort; Component[1].CompName = "Is short entry allowed"; } else if (SlotType == SlotTypes.Close) { Component[0].DataType = IndComponentType.CloseLongPrice; Component[0].CompName = "Long position closing price"; Component[1].DataType = IndComponentType.CloseShortPrice; Component[1].CompName = "Short position closing price"; } else if (SlotType == SlotTypes.CloseFilter) { Component[0].DataType = IndComponentType.ForceCloseLong; Component[0].CompName = "Close out long position"; Component[1].DataType = IndComponentType.ForceCloseShort; Component[1].CompName = "Close out short position"; } } public override void SetDescription() { EntryPointLongDescription = "No Entry"; EntryPointShortDescription = "No Entry"; EntryFilterLongDescription = "No Entry"; EntryFilterShortDescription = "No Entry"; ExitPointLongDescription = "No Exit"; ExitPointShortDescription = "No Exit"; ExitFilterLongDescription = "No Exit"; ExitFilterShortDescription = "No Exit"; } public override string ToString() { return IndicatorName; } } }
//+--------------------------------------------------------------------+ //| Copyright: (C) 2014, Miroslav Popov - All rights reserved! | //| Website: http://forexsb.com/ | //| Support: http://forexsb.com/forum/ | //| License: Proprietary under the following circumstances: | //| | //| This code is a part of Forex Strategy Builder. It is free for | //| use as an integral part of Forex Strategy Builder. | //| One can modify it in order to improve the code or to fit it for | //| personal use. This code or any part of it cannot be used in | //| another applications without a permission. Contact information | //| cannot be changed. | //| | //| NO LIABILITY FOR CONSEQUENTIAL DAMAGES | //| | //| In no event shall the author be liable for any damages whatsoever | //| (including, without limitation, incidental, direct, indirect and | //| consequential damages, damages for loss of business profits, | //| business interruption, loss of business information, or other | //| pecuniary loss) arising out of the use or inability to use this | //| product, even if advised of the possibility of such damages. | //+--------------------------------------------------------------------+ #property copyright "Copyright 2014, Miroslav Popov" #property link "http://forexsb.com" #property version "1.00" #property strict #include <Forexsb.com/Indicator.mqh> #include <Forexsb.com/Enumerations.mqh> //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class NoNoIndicator : public Indicator { public: NoNoIndicator(SlotTypes slotType) { SlotType=slotType; IndicatorName="NoNo Indicator"; WarningMessage = ""; IsAllowLTF = true; ExecTime = ExecutionTime_DuringTheBar; IsSeparateChart = false; IsDiscreteValues = false; IsDeafultGroupAll = false; } virtual void Calculate(DataSet &dataSet); }; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void NoNoIndicator::Calculate(DataSet &dataSet) { Data=GetPointer(dataSet); // Saving the components ArrayResize(Component[0].Value,Data.Bars); ArrayInitialize(Component[0].Value, 0); Component[0].FirstBar=0; ArrayResize(Component[1].Value,Data.Bars); ArrayInitialize(Component[1].Value, 0); Component[1].FirstBar=0; // Sets the Component's type. if(SlotType==SlotTypes_Open) { Component[0].DataType = IndComponentType_OpenLongPrice; Component[0].CompName = "Long position entry price"; Component[1].DataType = IndComponentType_OpenShortPrice; Component[1].CompName = "Short position entry price"; } else if(SlotType==SlotTypes_OpenFilter) { Component[0].DataType = IndComponentType_AllowOpenLong; Component[0].CompName = "Is long entry allowed"; Component[1].DataType = IndComponentType_AllowOpenShort; Component[1].CompName = "Is short entry allowed"; } else if(SlotType==SlotTypes_Close) { Component[0].DataType = IndComponentType_CloseLongPrice; Component[0].CompName = "Long position closing price"; Component[1].DataType = IndComponentType_CloseShortPrice; Component[1].CompName = "Short position closing price"; } else if(SlotType==SlotTypes_CloseFilter) { Component[0].DataType = IndComponentType_ForceCloseLong; Component[0].CompName = "Close out long position"; Component[1].DataType = IndComponentType_ForceCloseShort; Component[1].CompName = "Close out short position"; } } //+------------------------------------------------------------------+
Risk warning: Forex, spread bets and CFD are leveraged products. They may not be suitable for you as they carry a high degree of risk to your capital and you can lose more than your initial investment. You should ensure you understand all of the risks.
Copyright © 2006 - 2024, Forex Software Ltd.;