SetStopLoss on Entry Bar

Questions about MultiCharts and user contributed studies.
escamillo
Posts: 197
Joined: 25 Mar 2011
Has thanked: 22 times
Been thanked: 55 times

SetStopLoss on Entry Bar

Postby escamillo » 16 Dec 2011

For the code:

Code: Select all

SetStopContract ;
SetStopLoss(200) ;
(among other iterations)

NO Stop shows up on the Entry Bar, but a Stop does appear after the close of the Entry Bar.

This is confirmed by the "Order and Position Tracker", which show NO order "Sent" on the Entry Bar BUT DOES show an order "SENT" at the open of the new bar after the Entry Bar.

This is kind of a big problem, and I am readily willing to concede that I am missing something, however, it is my understanding that SetStopLoss is SUPPOSED TO BE active immediately after an order is generated, not after the completion of the Entry Bar.

Can you please indicate how a Stop Loss (preferably using SetStopLoss) can be created for the Entry Bar and Entry Bar ONLY? Attached show same chart with same code listed above: first one with time remaining on Entry Bar (no stop generated); second one after completion of the Entry Bar (with stop generated at completion of Entry Bar). Thanks.
Attachments
EntryBar with NO STOP.png
EntryBar with NO STOP.png (27.86 KiB) Viewed 974 times
Post EntryBar WITH STOP.png
Post EntryBar WITH STOP.png (28.32 KiB) Viewed 982 times

arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 times

Re: SetStopLoss on Entry Bar

Postby arjfca » 18 Dec 2011

Have you tried to set your code with IntraBarOrderGeneration = True at the begining of your code?

Code: Select all

[IntrabarOrderGeneration = True];

That may resolve the problem.

IntrabarOrderGeneration (IOG) allow orders to be set, modified during the creation of the bar. Otherwhise, all modification or new order will be sent at the beginning of a new bar.

A stoploss is a new order, hence will be created at the beginning of the next bar if IOG is not set to True

Martin
These users thanked the author arjfca for the post:
escamillo

escamillo
Posts: 197
Joined: 25 Mar 2011
Has thanked: 22 times
Been thanked: 55 times

Re: SetStopLoss on Entry Bar

Postby escamillo » 18 Dec 2011

arjfca,

Thanks for your reply. That WILL work for me. Since I only use SetStopLoss on the Entry Bar, it works for me in form:

Code: Select all

[IntraBarOrderGeneration = TRUE]
SetStopContract ;
If BarsSinceEntry = 0 then SetStopLoss(200) ;
I will have to take the Entry Bar Stop out of the rest of the Stop code that I use, which does not use IBOG, and create a separate 'Signal/Stat' document - a relatively minor inconvenience and much better than not having a working Entry Bar Stop.

Thanks arjfca for the heads up to go in that direction.


FOR MultiCharts: From your 'Keyword Reference', regarding SetStopLoss it says:

"SetStopLoss function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry."

Which has always been my understanding EVEN IF SET TO [IntraBarOrderGeneration = FALSE] - in practice that IS NOT the case - there is NO Entry Bar protection when IntraBarOrderGeneration = FALSE. Could you please address and clarify this issue?
Attachments
Stop on Entry Bar using SetStopLoss with IBOG=TRUE.png
Stop on Entry Bar using SetStopLoss with IBOG=TRUE.png (31.58 KiB) Viewed 944 times

User avatar
TJ
Posts: 6586
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1907 times

Re: SetStopLoss on Entry Bar

Postby TJ » 18 Dec 2011

escamillo wrote:arjfca,

Thanks for your reply. That WILL work for me. Since I only use SetStopLoss on the Entry Bar, it works for me in form:

Code: Select all

[IntraBarOrderGeneration = TRUE]
SetStopContract ;
If BarsSinceEntry = 0 then SetStopLoss(200) ;
I will have to take the Entry Bar Stop out of the rest of the Stop code that I use, which does not use IBOG, and create a separate 'Signal/Stat' document - a relatively minor inconvenience and much better than not having a working Entry Bar Stop.

Thanks arjfca for the heads up to go in that direction.


FOR MultiCharts: From your 'Keyword Reference', regarding SetStopLoss it says:

"SetStopLoss function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry."

Which has always been my understanding EVEN IF SET TO [IntraBarOrderGeneration = FALSE] - in practice that IS NOT the case - there is NO Entry Bar protection when IntraBarOrderGeneration = FALSE. Could you please address and clarify this issue?


see post #3
viewtopic.php?f=16&t=6929

escamillo
Posts: 197
Joined: 25 Mar 2011
Has thanked: 22 times
Been thanked: 55 times

Re: SetStopLoss on Entry Bar

Postby escamillo » 23 Jan 2012

Would someone from MultiCharts please comment on whether or not SetStopLoss (+ SetPercentTrailing, etc.) is supposed to work on an Entry Bar without having IntraBarOrderGeneration being set to 'True'; and then please comment on the way it is actually working (it very clearly DOES NOT work on an Entry Bar for me in v7.4 in code set to [IntraBarOrderGeneration = FALSE]).

From a TS tech: "For the entry bar protection, you can use the built-in stop "SetStopLoss" and enter the ATR * BigPointValue. "SetStopLoss" provides entry bar protection and is executed intrabar as are the other strategy orders."

I would appreciate clarification on this issue. Thanks.
These users thanked the author escamillo for the post:
Laurent

User avatar
Roman MultiCharts
Posts: 50
Joined: 28 Nov 2011
Has thanked: 21 times
Been thanked: 67 times

Re: SetStopLoss on Entry Bar

Postby Roman MultiCharts » 25 Jan 2012

Hello escamillo,

The behavior that you described cannot be reproduced on our end. Please come to our Live Chat Mon-Fri 6.30AM - 1 PM EST, the main engineer dealing with this subject will be available to investigate this issue on your end.

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 22 times

Re: SetStopLoss on Entry Bar

Postby Katrin Yanenko » 01 Feb 2012

Hi,


We’ve confirmed this issue and our team is in the process of fixing it.
As a workaround please try to use both ++LE MIT and SetStopLoss signals with IOG off, or both with IOG on.

Best Regards,
Katrin Yanenko
These users thanked the author Katrin Yanenko for the post:
TJ


Return to “MultiCharts”