Topic: Forex Strategy Builder source code

The source code of Forex Strategy Builder is available through GitHub.com https://github.com/PopovMP/Forex-Strategy-Builder.

Please read the FSB Source Code License Agreement before start exploring the project.

Re: Forex Strategy Builder source code

Hello Mr Popov,
in the ToDo.txt, it has:

Permanent Protection Type:
v Absolute and Relative Permanent SL / TP

(v means done) but what is the "Relative SL / TP"? Is this similar to the "Profit Protection" concept from Nicholas K from this thread:
http://forexsb.com/forum/topic/1489/tra … ing-logic/
His idea: after a certain level of profit (one parameter), if the profit drops a certain percentage (second parameter) from the peak profit of the position, it exits. Is this similar?

Thanks

Re: Forex Strategy Builder source code

The default condition of the Permanent SL and TP is "Relative". It corresponds to the older FSB versions and the current FST. Basically it means that any modification of an open position (adding, reducing ...) changes also the SL and TP levels. SL and TP are relevant to the last modification order.

Contrary to that behaviour, the "Absolute" type of SL or TP makes them unchengiable until the position is closed. In that way, the TP and SL are set when we open a position and further adding or reducing doesn't change them.

Actually you can see the difference between both options only when the strategy adds or reduces a position. Reversing a position is equal to close and open a new one in the opposite direction, therefore FSB applyes new TP and SL levels.

"Absolute" option is not compativble with the current FST.

Re: Forex Strategy Builder source code

I'm working through the Backtester class (Backtest Calculator.cs). It's long, so I will try to read through it, with a few questions on small points.
First one -- What is the WayPoint class for, what does it do?
Second -- where does the loop through the Bars happen? I'd like to pass the highest floating PL and an activation boolean for each bar in the position to calculate a trailing stop. So far, I have added a couple properties to the Position class for that, just trying to figure out how to get the stop value to pass along with each Transfer order.
Thanks

Re: Forex Strategy Builder source code

First one -- What is the WayPoint class for, what does it do?

FSB stores the backtest in the array static Session[] session;.
Each session is one backtested bar.
The actual activities from the backtest are stored as Way_Points in the session.
Each Way_Point contains the activity price, type, order and position (if any).
All available activities are:

public enum WayPointType
{
    None, Open, High, Low, Close, Entry, Exit, Add, Reduce, Reverse, Cancel
}

Open, High, Low, Close waypoints shows when the backtester reaches the corresponding price levels.

Entry, Exit, Add, Reduce, Reverse are the transactions.

Cancel shows when the backtester cancels orders.

...

You can see all this represented in the "Bar Explorer".

Re: Forex Strategy Builder source code

Second -- where does the loop through the Bars happen?


        /// <summary>
        /// The main calculating cycle
        /// </summary>
        public static void Calculation()
        {

It's in the "Backtester Calculator.cs" file

Re: Forex Strategy Builder source code

When drawing schedules unpleasant blinking are observ.
I offers small changes in visual components (smallbalancechart, etc.). 3rd lines of a code + my class. Blinking are not present. If interested, inform where to lay out a code.

Re: Forex Strategy Builder source code

Serfel, thank you for improving FSB. You can open a topic in the forum and to attach your contribution.