Login Page - Create Account

Support Board


Date/Time: Wed, 25 Dec 2024 06:57:26 +0000



Post From: ACSIL: trailing by entry example please

[2015-11-03 12:37:24]
User44052 - Posts: 34
Hello.

I've tried looking at the tradingsystem.cpp file, and tried applying the info on the documentation page (http://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html#s_SCTradeOrder), but I still can't get my ACSIL code right. Can you please give me an example of how to construct the s_SCNewOrder to do the following.

A condition becomes true at price X, let's say a crossover (from above) happens at price X, and price is continuing to fall.
I want to buy as low as possible below X, so...
When my condition becomes true, I want to send a Trailing Stop Buy order.
I want to set it at 14 ticks above X.

In other words, if the crossover happens at X, and the price immediately starts going up, I want to be stopped into buying it at X+14 ticks.
Otherwise, if price continues to fall, I want the buy point to come down gradually.

Once I'm in long, I want the profit target to be 25 ticks, above the entry price (not above X).

From the documentation I understand that I need to build s_SCNewOrder as an attached order, but I've tried different combinations of ::Price1 and ::Target1Offet and ::AttachedOrderStop1Type, but I can't get it to work.

Please help with an example of what needs to be sent to create this order

NewOrder.Quantity = 1;
NewOrder.????;
NewOrder.????;