Login Page - Create Account

Support Board

Date/Time: Sun, 26 Jun 2022 22:40:45 +0000

Trying to Understanding ASCIL Trading / Trading Example

View Count: 920

[2014-01-27 09:54:43]
Israel Gottlieb - Posts: 14
Dear Sierra,

I am studying autotrading using the examples you provide. I started with the simplest one, called "Trading Example" [entry on MA crossover, exit when stop offset or target offset hit; no attached orders]. I applied it to an E-mini intraday chart, and ran Bar Backtests and Replay Backtests. I tried the Bar Backtest also w/ historical data. Please advise on the below 2 questions:

1. In all cases, the Trade Activity shows that Exits were always applied exactly 1 tick (1/4 point) away from the Entry price, resulting in a consistent string of loses of exactly 1 tick. Changing the input values of the Study had no effect.

2. In an effort to understand the above behavior, I copied the TradeSystem code into my own custom study project, compiled w/ VC++ Express, set breakpoints and attached to the Sierra process. When I ran the backtest (both Bar-Backtest & Replay), I found that the Result value returned by the call sc.BuyEntry(NewOrder) was always negative; in fact it was always -8998. Further, the code that writes arrows on the chart when an order is successful was skipped by the 'if' statement -- as you would expect if the Result was negative. I verified this behavior by adding a condition of 'Result > 0' to the breakpoint; it was never hit. However, after the code completed running, the chart was full of arrows and TradeActivity showed a string of trades -- all exited exactly 1 tick from entry. What am I missing?

Thanks for any guidance,
I. Gottlieb

To post a message in this thread, you need to log in with your Sierra Chart account:


Login Page - Create Account