Login Page - Create Account

Support Board


Date/Time: Tue, 14 Jan 2025 12:05:20 +0000



Post From: ACSIL Trading offsets

[2016-02-14 02:38:03]
rhovega - Posts: 279
EUREKA!

As reference for anyone interested, this is what I did:

On an existing trading system (from tradingsystem.cpp):

1. Defined: SCSubgraphRef ATRSubgraph = sc.Subgraph[5]
2. Calculated the ATR: sc.ATR(sc.BaseDataIn, ATRSubgraph, 20, MOVAVGTYPE_SIMPLE)
3. Got the ATR's value: float ATRAtIndex = sc.Subgraph[5].Data[sc.Index]
4. In the target/stop function, replaced "X*sc.TickSize" by "ATRAtIndex"

Thanks Kiwi

btw use the trailing stop you made a lot, awesome work!