|
| Envoyé par théo le 23 Octobre 2005 à 22:42
|
|
|
J'ai developpé une stratégie en EL en mode backtesting sur des emini. Mais je ne sais pas comment va réagir cette stratégie en temps réel.En effet, me stratégie implique de déclencher des ordres d'achat/vente sur la barre courante ; or, avec EL en backtesting les ordres ne sont déclenchés que la barre suivante, ou alors je n'ai pas tout compris ...
Quelqu'un peut-il m'éclairer sur ces deux fonctionnements pour une stratégie : en backtest et en mode temps réel.
Merci d'avance pour votre aide.
|
|
Haut de la page |
| |
|
|
| |
| Envoyé par marcd le 28 Octobre 2005 à 11:34
|
|
|
En tradestation, mode backtest, les ordres ne sont declenches que sur la barre suivante mais ils peuvent s'executer n'importe quand au cours de cette barre. Si tu positionnes un ordre de stop sur une barre par exemple, tradestation executera virtuellement l'ordre des que ce seuil sera franchi. L'option look inside bar permet a tradestation de savoir si ou quand l'ordre s'executera
en mode reel par contre et depuis tradestation 8.1 tu peux passer un ordre en temps reel. Dans ce cas le prix en cours est considere comme le prix de cloture de la barre. Tu peux donc dire
IF close > 10.23 then
buy at market
et l'ordre s'executera si le prix de la barre en cours franchit 10.23
Cela repond-il a ta question ?
__________________ Marc Defosse
|
|
Haut de la page |
| |
| Envoyé par théo le 09 Novembre 2005 à 05:50
|
|
|
Bonjour Marc,
Merci d'avance pour ces infos, mais quand j'écris dans une stratégie ([temps réél et non en backtest ) la commande suivante :
" IF Close > 10.23 then buy at market " afin de pouvoir déclencher l'achat sur la barre courante, j'ai alors des erreurs de compilation de ce code indiquant qu'il n'accepte pas ce genre de syntaxe, et qu'il est nécessaire d'indiquer next bar.
Autre petite question EL
Existe-t-il un moyen de déterminer dans une stratégie que le dernier trade exécuté a été perdant ?
Merci d'avance pour ton aide.
|
|
Haut de la page |
| |
| Envoyé par marcd le 09 Novembre 2005 à 11:14
|
|
|
If close > 10.23 then
buy this bar on close;
pour la barre courante, tradestation / easylanguage demande de preciser this bar on close sinon next bar at market.
Dans les proprietes de la strategie il faut indiquer que tu souhaites travailler en temps reel egalement
__________________ Marc Defosse
|
|
Haut de la page |
| |
| Envoyé par théo le 15 Novembre 2005 à 22:31
|
|
|
Bonjour,
J'ai écrit une stratégie pour du temps réel basée sur une échelle temporelle de chandeliers de 15 mn avec des déclenchements d'achat ou de vente avec des ordres du type "buy this bar on close".
Or, malgré que les conditions d'achat ou de vente soient remplies, les ordres d'achat/vente ne se déclenchent jamais sur la barre courante.
Mon code est OK. L'operation "Générate Stratégie Orders" est cochée.
Par contre, je n'ai pas de compte chez TS. Je n'ai uniquement un flux temps réel sur des futures Emini.
Pouvez-vous m'expliquer pourquoi cela ne fonctionne pas.
Merci d'avance pour votre aide.
|
|
Haut de la page |
| |
| Envoyé par marcd le 16 Novembre 2005 à 11:12
|
|
|
Regarde dans les proprietes des strategies de tradestation (Clic droit + Format strategy + Properties) pour voir si tes ordres sont autorises pour se declencher en temps reel (c'est different de Generate Strategies...)
__________________ Marc Defosse
|
|
Haut de la page |
| |
| Envoyé par théo le 18 Novembre 2005 à 00:49
|
|
|
Bonjour Marc,
J'ai regardé dans les propriétés des strategies de tradestation (Clic droit + Format strategy + Properties), je n'ai pas les droits pour modifier l'onglet Automation. Est-ce pour cette raison que je ne vois mes ordres se déclencher sur la barre courante ( chandelier de 15')
par la commande "buy this bar on close" ?
PI. je n'ai pas de compte chez TS. Je n'ai uniquement un flux temps réel sur des futures Emini.
Merci d'avance
|
|
Haut de la page |
| |
| Envoyé par b6228 le 01 Décembre 2005 à 18:19
|
|
|
Salut Théo,
ci-dessous un extrait du forum TS (je ne suis pas certain que si tu n'as pas de compte chez eux tu aies accès aux forums).
J'espère que cela t'aidera.
>>>>>
In TradeStation 8.1, strategies can update intrabar and do not need to wait until the bar close to generate an order. Intrabar order generation allows Buy, Sell, Short and Cover orders to be generated on a tick basis during an open bar, instead of only at the close of a bar. The intrabar order generation feature is enabled by selecting the ‘Enable intrabar order generation and calculation’ check box on the Format Strategy Dialog – Calculation Tab.
If checked, orders can be generated as frequently as every tick during a bar. If unchecked, orders can be generated only on bar close (or at bar open for ‘open next bar’ strategies).
The setting is disabled by default. The value of the setting is associated with each individual strategy that is applied to a chart. Different strategies in the same strategy group may have different settings.
When ‘Enable intrabar order generation and calculation’ is checked a choice is provide to determine whether fills should occur more than once per bar.
• If ‘Limit entries from same signal in this strategy and exits from same signal in this strategy to once per bar’ is selected, each entry and exit order from the same signal can be filled only one time per bar (even if Position Limits settings have pyramiding enabled). This option is selected by default.
• If ‘Limit entries from all signals in this strategy and exits from all signals in this strategy to once per bar’ is selected, the strategy will enter and exit only once per bar.
• If ‘Allow any entry from this strategy and any exit from this strategy to occur multiple times per bar’ is selected, the strategy may enter and exit from the same or from different signals as many times per bar as conditions dictate.
What does [0] now mean?
When “Enable intrabar order generation” is enabled then [0] refers to the in-progress bar.
How will historical calculations work?
When “Enable intra-bar order generation” is disabled historical calculations will behave as they did in prior TradeStation versions. When the intrabar calculation setting is enabled, historical calculations will vary based on the ‘Look-Inside-Bar’ back-testing settings:
- Historical calculations with Look-Inside-Bar Back-testing disabled:
When Look-Inside-Bar Back-testing disabled, historical strategy calculations will occur 4 times per bar on the Open, High, Low, and Close of the historical bar.
The actual calculation order will depend on the proximity of the high and low to the open. If the open is closer to the high then calculations will proceed in the following order: Open, High, Low, and then Close. If the open is closer to the low then calculations will proceed in the following order: Open, Low, High, and Close.
Volume is split between the 4 points (Volume / 4). Open interest will not be divided by 4
- Historical calculations with “Look-Inside-Bar Back-testing” enabled:
When Look-Inside-Bar Back-testing” is enabled, historical strategy calculations will occur on the Open, High, Low, and Close of each interim ‘Look-Inside’ bar. If using tick resolution, a calculation will occur on the tick only. The high and low will update on each interim Look-Inside bar to simulate the creation of a bar in progress. After the last Look-Inside bar is processed a calculation will occur one more time on the actual close of the bar.
Intrabar on Multiple Datastream Charts
Intrabar order generation is not allowed on multiple datastream charts.
Open next bar systems
Enable Intra-bar order generation is not allowed for open next bar systems. However, since calculations can occur on each tick during the bar, EasyLanguage code can detect the open of the bar and execute specific code at the open. This enables ‘open next bar’ type strategies to be rewritten as intrabar strategies, if desired.
How to write code that evaluates intrabar, and places orders intrabar?
Enable intra-bar order generation and calculation for the strategy on the Format Strategy Dialog – Calculation Tab.
Write the EasyLanguage code to place the order as a ‘next bar’ order; it will be active for the next tick for the in-progress bar.
For example:
if MarketPosition <> 1 and close > close[1] then
buy next bar at market ;
This will place a market order for the next tick of the in-progress bar, if the close of the current in-progress bar is greater than the close of the prior bar.
How to write code that evaluates intrabar, but places orders only on the bar close?
Use the BarStatus reserved word. For example:
If BarStatus(1) = 2 then
{ place orders for next bar }
buy next bar at market ;
IntrabarOrderGeneration EasyLanguage Attribute
An attribute has been added to EasyLanguage [IntrabarOrderGeneration=True/False] that allows the intrabar order generation capability to be turned on or off from within EasyLanguage. This attribute value will override the user interface setting in the Format Strategy dialog.
If the attribute is not present in the strategy code, the intrabar order generation and calculations setting will be controlled through the Calculations tab of the format Strategy window. If the attribute is present and set to TRUE, the ‘Enable intrabar order generation and calculation’ flag will be checked, the checkbox will be disabled, and the radio buttons will be available.
If the attribute is present and set to FALSE, the ‘Enable intrabar order generation and calculation’ flag will unchecked and the checkbox and radio buttons will be disabled.
The syntax for the attribute is as follows:
[IntrabarOrderGeneration = Value] where Value can be TRUE or FALSE
The attribute may only be used in a strategy. Attributes are evaluated at compile time only, so their values cannot be changed at run-time.
Usage Example:
[IntrabarOrderGeneration = FALSE] // Strategy will only generate orders at close of bar
Mark Mills
EasyLanguage Engineer, TradeStation Securities, Inc.
<<<<<
Si tu as accès à leurs forums, l'url est la suivante :
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID =36421
Je ne sais pas quel est ton niveau dans le développement des stratégies sur futures mais fait bien attention au slippage. Personnellement, je paramètre un tick au moins sur le mini SP pour les backtest, ce qui est encore optimiste car dans la réalité c'est plutôt un tick à l'entrée et un à la sortie.
Stéphane
__________________ b6228
|
|
Haut de la page |
| |
| Envoyé par théo le 03 Décembre 2005 à 12:53
|
|
|
Salut Stéphane,
J'ai activé l'option ‘Enable intrabar order generation and calculation’ dans la Format Strategy Dialog – Calculation Tab, en essayant d'activer chacune des 3 options afin de générer des ordres d'achat en temps réel sur futures emini avec des chandeliers de 15 mn.
J'ai simplifié ma stratégie au maximum afin de détecter si un signal d'achat se déclenchait sur la barre courante. Or, malgré que les conditions soient remplies, aucun ordre n'est déclenché sur la barre courante l'ordre "buy this bar on close"
Peux-tu m'expliquer ce qu'il se passe ?
Merci d'avance.
|
|
Haut de la page |
| |
| Envoyé par b6228 le 05 Décembre 2005 à 09:43
|
|
|
Bonjour Théo,
difficile de répondre comme cela.
Si ce n'est pas indiscret, tu peux m'envoyer ta stratégie (workspace et fichier eld) sur sri@skynet.be, je tenterai de résoudre ton problème.
Cordialement,
Stéphane
__________________ b6228
|
|
Haut de la page |
| |
|
|