Forex Indicators
Forex Software Forex Strategy Builder Forex Strategy Trader Strategies Blog Forum
Overview Download Rates Source Help Power Up Awards

Technical Indicators - Source Code

Here is the source code of the technical indicators included in Forex Strategy Builder. They are listed with an information purpose only.

These technical indicators are writen in .NET C#. If you want, you can use these indicators as base for writing of your own custom indicators. See for more details about the custom indicators in the forum.

All indicators are available for download here: Original_Indicators.zip.
The base classes and enumerations are here: Indicators_Base.zip.

Please post your comments or question into the forum. You can find additional information about the indicators into the help.

Technical Indicators

Top

Important Functions

Top

1-15 of 19 Comments
dlman
November 05, 2009 - 23:44

Similar to Oleg, is there a way for the stop or take profit (Stop Limit.cs indicator) to use the highs and lows, instead of the close? On my Forex trading platform, I can set a stop and a limit -- they are triggered by the hi or low, not the close.
In Stop Limit, the calculate function only has "return". The description says "The implimentation of logic is in Market.AnalyseClose(int iBar)". Is there a Market.AnalseHigh? Or can I make a custom version of the Market class?

BTW -- awesome app you have made. Thank you so much !!

Reply to dlman
Popov
November 07, 2009 - 10:23

Dear dlman,
I cannot understand the problem. The Stops and Limits beeng triggered once the price touches them. That's the temporary high or low.

The code of the Stop Limit indicator is in the backtester just because it has to place the SL or TP prices according to the specific position. The indicator doesn't know the entry price of the position. So I cannot make the calculations in the indicators source code.

The formula is SLPrice = EntryPrice - Stop * PipsValue

Forex Strategy Builder sends a separate pending StopLimit order for each position.

The trading platform Forex Strategy Trader uses StopLoss and TakeProfit parameters when sets the order in MetaTrader. Its implementation is in the expert Advisor. You can see it.

Oleg
September 24, 2009 - 10:36

Hi,
Is there a way to check if Previous Low was lower than BOLLINGER BAND?
Thank you!

Reply to Oleg
Miroslav Popov
September 29, 2009 - 19:29

This logic rule is not included in the original indicator. If you are familiar with programming you can easily add this to a custom BB indicator.

ANUJ
September 23, 2009 - 01:48

hi .

my name is anuj , i am an post graduate student "MTECH"
THESE DAYS I AM SIFTING THROUG NET TO GET SOME KIND OF HELP AND GUIDANCE IN MATLAB AND CFD I WILL BE GREAT FULL TO U I U CAN HELP ME

Mick
September 18, 2009 - 02:35

Hi,

Fantastic program you have developed. I have learned a lot about forex and strategies by using it.

I am writing a custom indicator for it now but I am having real problems tracing a defect in my logic. I have tried using the source code you provide but there are several data items missing that prevent me compiling and using debug to trace through my code and find the fault. Could you provide the missing bits of code to allow compilation or is there a way to debug using what you provide already.

Thanks again for wonderful program and keep up the good work.

Best Wishes
Mick

Reply to Mick
Miroslav Popov
October 02, 2009 - 07:04

Mick,
I'll try to add some debug capabilities to the custom indicators later.

joe almore
May 16, 2009 - 22:34

By the way, there is an enumerator called "Configs", in the file "indicators.cs" line 376-377, but it appears to have more values that it shows actually, is that so??, or it only has these two values:

SIGMA_MODE_SEPARATED_CHART,
SIGMA_MODE_MAIN_CHART

Thanks again.

Reply to joe almore
Miroslav Popov
May 16, 2009 - 22:46

These two parameters:
SIGMA_MODE_SEPARATED_CHART,
SIGMA_MODE_MAIN_CHART
are coming from the config.xml file. It's done in that way in order to allow the users to change the sigma mode.
The default values are:
SIGMA_MODE_MAIN_CHART = 1
SIGMA_MODE_SEPARATED_CHART = 5

ps.
-------------
Your questions are highly welcome. I'm in front of writing a guide about the custom indicators.

joe almore
May 16, 2009 - 22:17

Hello Miroslav,

I am having some troubles reading your code, I believe that may be you can help me with this, is just that I can not find the Class "DataPeriods" and the Element "Data" in the file "indicator.cs"

181 ///


182 /// Time frame of the loaded historical data
183 ///

184 protected static DataPeriods Period { get { return Data.Period; } }

Thanks, and good work.

Reply to joe almore
Miroslav Popov
May 16, 2009 - 22:27

Hello joe,

The property Period gives the period of the currently loaded instrument. It is of type DataPeriods, which is an enumeration:


public enum DataPeriods
{
min1 = 1,
min5 = 5,
min15 = 15,
min30 = 30,
hour1 = 60,
hour4 = 240,
day = 1440,
week = 10080
}

I think this is already explained in the forum. See Base Classes and Enumerations topic. There are some examples there also.

Regards,
Miroslav

Reply to joe almore
ahmedalhoseny
January 25, 2010 - 03:44

Hello
i searched the Enumerations.cs in the indicator base files and didnot find the public enum DataPeriods which described in the post
forexsb.com

Where in ( indicator base ) i can find it
Regards

Nick
March 07, 2009 - 13:00

I'm actually more interested in writing my own indicators...
If we can use our custom-made indicators to generate and optimize strategies, it'll be great!

Reply to Nick
Miroslav Popov
May 10, 2009 - 04:15

Hello Nick,
Custom indicators capability was added to Forex Strategy Builder v2.8.3.7b.

Sart
February 17, 2009 - 08:06

It would be useful to get possibility for experiments with Ihimoku Indicator lines. Are you planning to include this indicator?

Best Regards - Sart

Leave a Comment


?
?