Topic: Exit Long at S1

OK, this is another strategy generated by FSB that closes the positions in the wrong spot ( at least not the strategy logic closing conditions). If somebody could run this strategy and verify this, will be awsome.
Here is:
Strategy Overview
Forex Strategy Builder v2.56.4.0
Strategy name: GBPUSD-30-5-11-11
Date: 5/20/2011 9:23:13 PM

Table of Contents
Description
Logic
Environment
Strategy Properties
Indicator Slots
Statistic Information
Description
Automatically generated on 5/11/2011 10:17 PM.

Top

Logic
Opening (Entry Signal)
Open a new long position or add to an existing position at the Upper Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Open a new short position or add to an existing position at the Lower Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Closing (Exit Signal)
Close an existing long position 1141 pips above the Pivot Point Support 1 level.

Close an existing short position 1141 pips below the Pivot Point Resistance 1 level.

Handling of Additional Entry Signals**
Entry signal in the direction of the present position:

Add to the position no matter if it is at a profit or loss. Do not exceed the maximum allowed number of lots to open.
Entry signal in the opposite direction:

No modification of the present position is allowed. Cancel any additional orders which are in the opposite direction.
Trading Size
Trade percent of your account.

Opening of a new position - 0.1% of the account equity.
Adding to a position - 0.1% of the account equity. Do not open more than 19.88 lots.
Permanent Protection
The strategy does not provide a permanent loss limitation.

The Permanent Take Profit closes a position at 1000 pips profit.

--------------
* Use the indicator value from the previous bar for all asterisk-marked indicators!
** The averaging rules apply to the entry signals only. Exit signals close a position. They cannot open, add or reduce one.

Top

Environment
Market
Symbol - GBPUSD
Time frame - 30 Minutes

Account
Initial account - 1000.00 USD
Lot size - 10000
Leverage - 1/50
Required margin - 20.00 USD* for each open lot

Charges
Spread - 20 pips (2.00 USD*)
Swap number for a long position rollover - 2 pips (0.20 USD*)
Swap number for a short position rollover - -2 pips (0.20 USD*)
Commission per lot at opening and closing - 0 pips (0.00 USD*)
Slippage - 0 pips (0.00 USD*)

--------------
* This value may vary!

Top

Strategy Properties
Handling of Additional Entry Signals
Next same direction signal behavior - Adds to the position
Next opposite direction signal behavior - Does nothing

Trading Size
Trade percent of your account. The percentage values show the part of the account equity used to cover the required margin.

Maximum number of open lots - 19.88
Number of entry lots for a new position - 0.1% of the account equity
In case of addition - number of lots to add - 0.1% of the account equity
In case of reduction - number of lots to close - 0.1% of the account equity

Permanent Protection
Permanent Stop Loss - None

Top

Indicator Slots
The slots show the logic for the long positions only. Forex Strategy Builder automatically computes the proper logic for the short positions.

Strategy Properties
Same direction signal - Add
Opposite direction signal - Nothing
Permanent Stop Loss - None
Permanent Take Profit - 1000
Opening Point of the Position
Keltner Channel
Enter long at the Upper Band
Smoothing method - Simple
Base price - Close
MA period - 76
ATR period - 18
ATR multiplier - 1
Use previous bar value - Yes
Closing Point of the Position
Pivot Points
Exit long at S1 (short at R1)
Base price - One bar
Vertical shift - -1141
Use previous bar value - Yes

Top

Statistic Information
Market Account
Symbol GBPUSD Intrabar scanning Not accomplished
Period 30 Minutes Interpolation method Pessimistic scenario
Number of bars 16466 Ambiguous bars 4
Date of updating 04/26/11 Tested bars 16387
Time of updating 14:30 Initial account 1000.00 USD
Date of beginning 12/21/09 Account balance 2030.88 USD
Time of beginning 07:00 Minimum account 969.06 USD
Minimum price 1.4229 Maximum account 2030.88 USD
Maximum price 1.65976 Maximum drawdown 64.60 USD
Average Gap 5 pips Max equity drawdown 151.63 USD
Maximum Gap 1039 pips Max equity drawdown 14.33 %
Average High-Low 209 pips Gross profit 1247.08 USD
Maximum High-Low 1960 pips Gross loss -216.20 USD
Average Close-Open 103 pips Sent orders 125092
Maximum Close-Open 1540 pips Executed orders 1980
Maximum days off 3 Traded lots 37.8100000000005
Maximum data bars 20000 Winning trades 69
No data older than No limits Losing trades 12
No data newer than No limits Win/loss ratio 0.85
Fill In Data Gaps Switched off Time in position 82 %
Cut Off Bad Data Switched off Charged spread 37.98 USD
  Charged rollover 14.52 USD
  Charged commission 0.00 USD
  Charged slippage 0.00 USD
  Total charges 52.50 USD
  Balance without charges 2083.38 USD
  Account exchange rate Not used

Top

Re: Exit Long at S1

http://s4.postimage.org/wriu5a1w/screen_2.jpg

Re: Exit Long at S1

Check the closing at 3/18/2011 @ 16:30, where the S1 is 1.62148 and the order closed at 1.62245 .Where are the 1141 pips?

Re: Exit Long at S1

OK, this is weird, I just used the same values from the strategy  generated by FSB and created a new one with the same logic ,etc. Well, the results are completelly different.Check this out:
Strategy Overview
Forex Strategy Builder v2.56.4.0
Strategy name: New
Date: 5/20/2011 10:04:48 PM

Table of Contents
Description
Logic
Environment
Strategy Properties
Indicator Slots
Statistic Information
Description
(This description might be outdated!)

This is an "empty" strategy.

You can use it as a base to build your strategy from scratch.

Feel free to experiment!

You can set the opening and the closing point of the position, add opening or closing logic conditions, and adjust the strategy properties.

The "Opening Point of the Position" slot shows the price, at which the strategy enters the market and adds/removes from an open position. We enter the market at a price level determined by an indicator value or by time ("Bar Opening" for example). However, before we open position we need confirmation from the "Opening Logic Condition" slots.

The "Opening Logic Conditions" basically tell you whether to enter the market or not when the entry price has been reached. They also determine the position's direction (whether we enter short or long). There is no any "Opening Logic Condition" in this strategy and that leads to undetermined entry direction. Because of that the program doesn’t open positions during the backtest.

The "Closing Point of the Position" sets the exit price. If you set it at "Bar Closing", you can add "Closing Logic Conditions". They will block the exit until at least one of them is fulfilled. If you do not use "Closing Logic Conditions", the position will be closed when the "Closing Point" is reached.

The Strategy Overview explains the strategy logic in an additional window and can be exported to a file.

Look in the forum for help or more information on creating forex strategies.

Remember! The strategy slots describe the long position logic only. Forex Strategy Builder will set the short position logic automatically using the same logic but in the opposite direction.


Top

Logic
Opening (Entry Signal)
Open a new long position or add to an existing position at the Upper Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Open a new short position or add to an existing position at the Lower Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Closing (Exit Signal)
Close an existing long position 1141 pips above the Pivot Point Support 1 level.

Close an existing short position 1141 pips below the Pivot Point Resistance 1 level.

Handling of Additional Entry Signals**
Entry signal in the direction of the present position:

Add to the position no matter if it is at a profit or loss. Do not exceed the maximum allowed number of lots to open.
Entry signal in the opposite direction:

No modification of the present position is allowed. Cancel any additional orders which are in the opposite direction.
Trading Size
Trade percent of your account.

Opening of a new position - 1% of the account equity.
Adding to a position - 1% of the account equity. Do not open more than 19.88 lots.
Permanent Protection
The Permanent Stop Loss limits the loss of a position to 1000 pips per open lot (plus the charged spread and rollover).

The strategy does not use a Permanent Take Profit.

--------------
* Use the indicator value from the previous bar for all asterisk-marked indicators!
** The averaging rules apply to the entry signals only. Exit signals close a position. They cannot open, add or reduce one.

Top

Environment
Market
Symbol - GBPUSD
Time frame - 30 Minutes

Account
Initial account - 1000.00 USD
Lot size - 10000
Leverage - 1/50
Required margin - 20.00 USD* for each open lot

Charges
Spread - 20 pips (2.00 USD*)
Swap number for a long position rollover - 2 pips (0.20 USD*)
Swap number for a short position rollover - -2 pips (0.20 USD*)
Commission per lot at opening and closing - 0 pips (0.00 USD*)
Slippage - 0 pips (0.00 USD*)

--------------
* This value may vary!

Top

Strategy Properties
Handling of Additional Entry Signals
Next same direction signal behavior - Adds to the position
Next opposite direction signal behavior - Does nothing

Trading Size
Trade percent of your account. The percentage values show the part of the account equity used to cover the required margin.

Maximum number of open lots - 19.88
Number of entry lots for a new position - 1% of the account equity
In case of addition - number of lots to add - 1% of the account equity
In case of reduction - number of lots to close - 1% of the account equity

Permanent Protection
Permanent Stop Loss 1000 pips

Top

Indicator Slots
The slots show the logic for the long positions only. Forex Strategy Builder automatically computes the proper logic for the short positions.

Strategy Properties
Same direction signal - Add
Opposite direction signal - Nothing
Permanent Stop Loss - 1000
Permanent Take Profit - None
Opening Point of the Position
Keltner Channel
Enter long at the Upper Band
Smoothing method - Simple
Base price - Close
MA period - 76
ATR period - 18
ATR multiplier - 1
Use previous bar value - Yes
Closing Point of the Position
Pivot Points
Exit long at S1 (short at R1)
Base price - One bar
Vertical shift - -1141
Use previous bar value - Yes

Top

Statistic Information
Market Account
Symbol GBPUSD Intrabar scanning Not accomplished
Period 30 Minutes Interpolation method Pessimistic scenario
Number of bars 16466 Ambiguous bars 5
Date of updating 04/26/11 Tested bars 16387
Time of updating 14:30 Initial account 1000.00 USD
Date of beginning 12/21/09 Account balance -0.18 USD
Time of beginning 07:00 Minimum account -0.18 USD
Minimum price 1.4229 Maximum account 1000.00 USD
Maximum price 1.65976 Maximum drawdown 1000.18 USD
Average Gap 5 pips Max equity drawdown 1013.12 USD
Maximum Gap 1039 pips Max equity drawdown 100.02 %
Average High-Low 209 pips Gross profit 704.58 USD
Maximum High-Low 1960 pips Gross loss -1704.77 USD
Average Close-Open 103 pips Sent orders 80254
Maximum Close-Open 1540 pips Executed orders 1635
Maximum days off 3 Traded lots 62.6199999999997
Maximum data bars 20000 Winning trades 11
No data older than No limits Losing trades 106
No data newer than No limits Win/loss ratio 0.09
Fill In Data Gaps Switched off Time in position 48 %
Cut Off Bad Data Switched off Charged spread 62.62 USD
  Charged rollover 11.12 USD
  Charged commission 0.00 USD
  Charged slippage 0.00 USD
  Total charges 73.74 USD
  Balance without charges 73.56 USD
  Account exchange rate Not used

Top

Re: Exit Long at S1

ok, this is interesting, so if I understand you correctly, it seems that proper closing point is not respected by FSB. I tried it out, and for now this is what I've come up with: firstly, it is a very sophisticated strat, as position addings and TP's are used together, it's a hard time tracking the trades. Therefore I simplified the strat by dropping TP and "add" function to see whether PP is faulty, the screenshot below shows my findings:
http://s3.postimage.org/y2qvkqis/image.jpg

PP works, and with TP too. If "add" is used, things get complicated, because it's tough to track the trades, if I remember correctly, TP is calculated on the first or the last trade price, and maybe similar logic is applied to PP's too. I hope Miroslav can clear this. If I were you, I would demo trade this strat, and then compare FSB/FST results, if there are no big discrepancies, it is safe to assume that calculation and backtest are done correctly - it is just the way FSB is programmed to behave, if you know what I mean.

6 (edited by i4xtoo 2011-05-21 13:48:18)

Re: Exit Long at S1

Hello footon,
In ther image you show the closing point is the same as S1, the vertical shift is 0. In my strategy the vert shift is 1141 pips. In order to compare you need to adjust the vert shift to the same value as mine to verify if the behavoir is the same in your PC as it is in mine. I also did what you suggested by droping add func. and T/P ,but still the problem stays. This is the overview after I removed the add and the take profit:
Strategy Overview
Forex Strategy Builder v2.56.4.0
Strategy name: GEN_GBPUSD-30-5-11-11
Date: 5/21/2011 8:26:11 AM

Table of Contents
Description
Logic
Environment
Strategy Properties
Indicator Slots
Statistic Information
Description
Automatically generated on 5/11/2011 10:17 PM.

Top

Logic
Opening (Entry Signal)
Open a new long position at the Upper Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Open a new short position at the Lower Band of Keltner Channel* (Simple, Close, 76, 18, 1).

Closing (Exit Signal)
Close an existing long position 1141 pips above the Pivot Point Support 1 level.

Close an existing short position 1141 pips below the Pivot Point Resistance 1 level.

Handling of Additional Entry Signals**
Entry signal in the direction of the present position:

No averaging is allowed. Cancel any additional orders which are in the same direction.
Entry signal in the opposite direction:

No modification of the present position is allowed. Cancel any additional orders which are in the opposite direction.
Trading Size
Trade percent of your account.

Opening of a new position - 0.1% of the account equity.
Permanent Protection
The strategy does not provide a permanent loss limitation.

The strategy does not use a Permanent Take Profit.

--------------
* Use the indicator value from the previous bar for all asterisk-marked indicators!
** The averaging rules apply to the entry signals only. Exit signals close a position. They cannot open, add or reduce one.

Top

Environment
Market
Symbol - GBPUSD
Time frame - 30 Minutes

Account
Initial account - 1000.00 USD
Lot size - 10000
Leverage - 1/50
Required margin - 20.00 USD* for each open lot

Charges
Spread - 20 pips (2.00 USD*)
Swap number for a long position rollover - 2 pips (0.20 USD*)
Swap number for a short position rollover - -2 pips (0.20 USD*)
Commission per lot at opening and closing - 0 pips (0.00 USD*)
Slippage - 0 pips (0.00 USD*)

--------------
* This value may vary!

Top

Strategy Properties
Handling of Additional Entry Signals
Next same direction signal behavior - Does nothing
Next opposite direction signal behavior - Does nothing

Trading Size
Trade percent of your account. The percentage values show the part of the account equity used to cover the required margin.

Maximum number of open lots - 19.88
Number of entry lots for a new position - 0.1% of the account equity
In case of addition - number of lots to add - 0.1% of the account equity
In case of reduction - number of lots to close - 0.1% of the account equity

Permanent Protection
Permanent Stop Loss - None

Top

Indicator Slots
The slots show the logic for the long positions only. Forex Strategy Builder automatically computes the proper logic for the short positions.

Strategy Properties
Same direction signal - Nothing
Opposite direction signal - Nothing
Permanent Stop Loss - None
Permanent Take Profit - None
Opening Point of the Position
Keltner Channel
Enter long at the Upper Band
Smoothing method - Simple
Base price - Close
MA period - 76
ATR period - 18
ATR multiplier - 1
Use previous bar value - Yes
Closing Point of the Position
Pivot Points
Exit long at S1 (short at R1)
Base price - One bar
Vertical shift - -1141
Use previous bar value - Yes

Top

Statistic Information
Market Account
Symbol GBPUSD Intrabar scanning Not accomplished
Period 30 Minutes Interpolation method Pessimistic scenario
Number of bars 16466 Ambiguous bars 1
Date of updating 04/26/11 Tested bars 16387
Time of updating 14:30 Initial account 1000.00 USD
Date of beginning 12/21/09 Account balance 1017.74 USD
Time of beginning 07:00 Minimum account 1000.00 USD
Minimum price 1.4229 Maximum account 1018.21 USD
Maximum price 1.65976 Maximum drawdown 2.76 USD
Average Gap 5 pips Max equity drawdown 9.54 USD
Maximum Gap 1039 pips Max equity drawdown 0.93 %
Average High-Low 209 pips Gross profit 21.38 USD
Maximum High-Low 1960 pips Gross loss -3.64 USD
Average Close-Open 103 pips Sent orders 81619
Maximum Close-Open 1540 pips Executed orders 21
Maximum days off 3 Traded lots 0.21
Maximum data bars 20000 Winning trades 8
No data older than No limits Losing trades 2
No data newer than No limits Win/loss ratio 0.80
Fill In Data Gaps Switched off Time in position 98 %
Cut Off Bad Data Switched off Charged spread 0.22 USD
  Charged rollover 0.96 USD
  Charged commission 0.00 USD
  Charged slippage 0.00 USD
  Total charges 1.18 USD
  Balance without charges 1018.92 USD
  Account exchange rate Not used

Top


For example, on 10/26/10 @ 8:30 a long pos is closed at 1.58656. The s1 level is 1.57960 they are 0.00696 apart, no 0.01141 as the strategy says. If you takes the closing price and substract the vertical shift of 1141 pips, the result is : 1.57515 and this value is not in any support or resistance levels or the pivot point level either. I even tried 0.1141 for the sake of it and no avail. The same happens with the short orders. On 5/6/10 @ 15:30, closes at 1.48566 and R1 is 1.49400, here the difference is 0.00834, so the vertical shift is different from long and short orders. Oviously something is wrong.
Thank you for your time helping me
i4xtoo

Re: Exit Long at S1

I set the vert shift, still everything works fine for me.

Two notes:

created a new one with the same logic ,etc.

You are not quite right - the first one has a TP of 1000, the second has a SL of 1000, it's obvious results vary.

Secondly, when you calculate the PP levels, do you take in to account the previous bar values? It's very important that you do, because the PP indi does.

Oh and another thought, I'm using "proven" version of FSB, 2.56.0.0, maybe that might be a crucial point, do you have an older version on your system? If you don't have, you may try with a newer beta to find out if your problem persists.

Lastly, if you switch the base price of PP to "one day" instead of "one bar", is the problem still there?

I'll give it more thought in the meantime.

Re: Exit Long at S1

When I talk about same result isn't about balance/profit or whatever, I'm talking about the same results related with the closing of the position based on the logic of the strategy ( exit long at 1141 pips above S1 level/ short at 1141 below R1).  I don't see where you get the 1000 S/L in the second version. The only thing I did was to set the "Next same direction signal behavior" to nothing and uncheck the permanent take profit. Those two changes were the only two I made as you suggested. Please check my previous post and the paste of strategy overview:
Permanent Protection
The strategy does not provide a permanent loss limitation.

The strategy does not use a Permanent Take Profit.

When you say " works for you", What exactly do you mind by that? Does your position is closed at 1141 pips from S1 or R1 depending if long or short?The picture of your screen shows the closing of the long position as the S1 level not at 1141 pips above it. Please check that.
FSB 256.4.0 is the release I'm using.
Check my posts "Use previous bar value" - Yes
Please, the most important question is wheter your strategy closes the positions at 1141 (or whatever vertical shift) pips or not.
Thank You footon for you help.
i4xtoo

Re: Exit Long at S1

The first 2 strats you posted (before any suggested changes were introduced):

Strategy Properties
Same direction signal - Add
Opposite direction signal - Nothing
Permanent Stop Loss - None
Permanent Take Profit - 1000

Strategy Properties
Same direction signal - Add
Opposite direction signal - Nothing
Permanent Stop Loss - 1000
Permanent Take Profit - None

You said you kept everything the same but results were different, SL and TP are not the same, hence the difference.

"Works for me" - yeah, it closes where it should, spot on logic wise.

Another point is that 1141 means 114 points because you have 5 digit data.

By previous bar value I mean when you manually calculate the numbers, you cannot take the PP value from the current bar (where position is closed), previous value has to be used, from the last finished candle. Hope you understand what I'm trying to say.

Please check the difference between PP base prices (one bar/one day)!

Re: Exit Long at S1

I'm sorry, I forgot the second strategy(post 4) I made from scratch using the generated values. I guess I switched T/P and S/L values. I see you were talking about this one , please just forget the strategy you see here in post #4, my comments on post # 6 where I say " I also did what you suggested by droping add func. and T/P ,but still the problem stays" were reffering to the third strategy (post 6). Compare the first and the one on post #6, they are the same just the second one(post 6) has no T/P or S/L:
Strategy Properties
Same direction signal - Nothing
Opposite direction signal - Nothing
Permanent Stop Loss - None
Permanent Take Profit - None
Check the prices for S1, and the closing price here:

http://s3.postimage.org/139mlsjes/screen_3.jpg

So, going backwards ,the long position here is closed at 1.64113 since my broker is a 5 digit one, the 1141 pips are the same as:
0.00001 * 1141 =0.01141 (pips*point) so, 1.64113-0.01141=1.62972(this is the price the S1 level should be(1141 above the S1 level), right?) , for current bar, S1=1.63889, and for previous bar S1=1.63761.
In your picture, the closing price is 1.3164 , S1 level= 1.31637. So, 1141 pips above S1(where the closing position should be) is about 1.32778. Can you post a pic of a closed order showing the 1141 pips vert. shift avobe the S1 level?
I'm sorry to be a pain in th a$$$ but, I want to understand how FSB deals with this.
Thanks

Re: Exit Long at S1

"By previous bar value I mean when you manually calculate the numbers, you cannot take the PP value from the current bar (where position is closed), previous value has to be used, from the last finished candle. Hope you understand what I'm trying to say."
I though that when you set "Use previous bar value " to yes, it means exactly that. I'm guessing the S1 level in current bar(day/hour/whatever time frame) is calculated from previous bar (H+L+C)/3, so if I see
S1 = 1.6000 in current bar that s1 level is for current bar since current bar opened. When the strategy says 1141 pips above the S1 level, it means==> Close the long position in this current bar if the price gets here:
current closing price= ((prevHigh+ prevLow + prevClose)/3 )+ 0.01141; where:
  ((prevHigh+ prevLow + prevClose)/3)= currentS1.
Thank you footon
i4xtoo

Re: Exit Long at S1

Here's my pic:
http://s4.postimage.org/19zi1c2lg/image.jpg

Hope this helps.

Re: Exit Long at S1

Wow, a pic worth a thousand words. That's exactly what I was expecting to see in my chart, but for some reasons FSB is doing something weird over here. I guess I need to keep playing a little bit longer, maybe re-install it. By the way did you see another of my posts about the Keltner Channel indic. drop down menu with a mix up of open/closing words usage. Please check that for me, If you tell me your is OK I'm going to throw the f.. machine out the window.
peace
i4xtoo

Re: Exit Long at S1

If previous bar usage is set to yes, previous bar value is used, and that's the only way to insure reliable backtest. I brought it up just to make sure that IF you manually track the trades or calculate the levels you won't make mistakes by looking the current bar's values.

Re: Exit Long at S1

i4xtoo wrote:

If you tell me your is OK I'm going to throw the f.. machine out the window.


I know the feeling big_smile

Hey, but before you re-install, please change the PP base price to "one day", and see whether it makes a difference. The thing is that like 2 years ago PP was working ok, but then Miro altered it, and base price "one day" stopped working. Few months back this bug was fixed, but there's a possibility that it created a new bug, it's crucial to be tested!

Thanks!

Re: Exit Long at S1

No, footon, thank you

Re: Exit Long at S1

PP to 1 day did the trick, you saved my computer wink
Thanks

Re: Exit Long at S1

I started up an old version of v2.9.1.0, and it's acting up too. This bug seems to be ancient.

Re: Exit Long at S1

Glad I could put down my $0.02  big_smile