How to abstract a functionality so it can run multiple strategy orders using ACSIL? - futures io
futures io futures trading



How to abstract a functionality so it can run multiple strategy orders using ACSIL?


Discussion in Sierra Chart

Updated by LittleFinger
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two LittleFinger with 1 posts (1 thanks)
    3. looks_3 bradhouser with 1 posts (0 thanks)
    4. looks_4 doetrader with 1 posts (0 thanks)
    1. trending_up 488 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

How to abstract a functionality so it can run multiple strategy orders using ACSIL?

(login for full post details)
  #1 (permalink)
Atlanta, Georgia, USA
 
 
Posts: 19 since Dec 2018
Thanks: 2 given, 0 received

I have an idea on how to implement certain part of my strategy, but I'm not sure how to go about implementing it.

From: www dot sierrachart dot com/ index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scVolumeAtPriceForBars

Say I have the following code below (not sure if it is completely correct, but I am trying to get the idea though):

 
Code
sc.VolumeAtPriceForBars->GetVAPElementAtPrice(sc.Index, scPriceValueToTicks(2450.75))
I want to be able to get the bid volume for that price in the current bar. Based off of that, I want to check if the bid volume is 200 or more. If it is, I want to send a strategy order directly coded in ACSIL (a parent order with attached orders--basically a bracket orders and stops.)

An order of such description could be open for many bars, however, my study could also open many many orders (up to 1000) that each span over many bars.


How would I go about keeping track of all those orders? How would I abstract things so that, if a certain condition happens, the study would go and update one or more of those orders depending on what I want (it could be canceling, changing price up or down, or quantity).

Has anyone perhaps done something resembling this that I can look at their code?

Reply With Quote

Can you help answer these questions
from other members on futures io?
IB Bracker Order
Platforms and Indicators
OPEN_CLOSE_DOTS
ThinkOrSwim
EQIX - Digital REITs - any experiences?
Stocks and ETFs
T​​​​​​radestation datafeed (real time and historical) to NT8
NinjaTrader
Times and Sales more data to be displayed
TradeStation
 
 
(login for full post details)
  #3 (permalink)
Merida, Yucatan, Mexico
 
 
Posts: 107 since Nov 2010
Thanks: 14 given, 61 received


Once a parent order is filled, the orderid is read from the NewOrder object, it needs to be kept in a persistent variable for future use.

 
Code
int ParentInternalOrderID = NewOrder.InternalOrderID;

Let's save that as persistent integer 1:

 
Code
sc.GetPersistentInt(1) = ParentOrderID;

Later on you can read the persistent integer and cancel it:

 
Code
sc.CancelOrder(sc.GetPersistentInt(1));

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Denver Colorado/USA
 
Experience: Intermediate
Platform: SierraChart
Broker: AMP
Trading: Bonds
 
LittleFinger's Avatar
 
Posts: 105 since May 2017
Thanks: 112 given, 123 received


doetrader View Post
I have an idea on how to implement certain part of my strategy, but I'm not sure how to go about implementing it.

From: www dot sierrachart dot com/ index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scVolumeAtPriceForBars

Say I have the following code below (not sure if it is completely correct, but I am trying to get the idea though):

 
Code
sc.VolumeAtPriceForBars->GetVAPElementAtPrice(sc.Index, scPriceValueToTicks(2450.75))
I want to be able to get the bid volume for that price in the current bar. Based off of that, I want to check if the bid volume is 200 or more. If it is, I want to send a strategy order directly coded in ACSIL (a parent order with attached orders--basically a bracket orders and stops.)

An order of such description could be open for many bars, however, my study could also open many many orders (up to 1000) that each span over many bars.


How would I go about keeping track of all those orders? How would I abstract things so that, if a certain condition happens, the study would go and update one or more of those orders depending on what I want (it could be canceling, changing price up or down, or quantity).

Has anyone perhaps done something resembling this that I can look at their code?

I coded a system that uses 3 orders and different stop management rules for each order. Here's some description from the code:

//after 8 ticks profit, the stop is raised to -3 ticks from our entry point
//at 17 profit, move up stop on one contract to entry point +10 ticks
//once we are +40, move the 50 target contract stop up to +25 ticks, leave the 80 tick target contract stop at breakeven
//after 68 ticks, the 80 tick target contract's stop is moved to +50

I am very rusty on ACSIL right now because I haven't used it for a few months, but I'm happy to share my code with you so you can learn from my methods.

I haven't tested this with live trading, but it works well in simulation. I've found it to be profitable during certain times for certain markets in certain conditions.

This system enters a trade once a breakout from a time-defined range occurs. There's no secret edge in this code, but the methods used in it could apply to many different trading systems.

Checking the volume as a condition for trade entry shouldn't be difficult.

I would become very familiar with this:
https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html

Send me a PM if you are interested in the code

-LF

Reply With Quote
The following user says Thank You to LittleFinger for this post:


futures io Trading Community Platforms and Indicators Sierra Chart > How to abstract a functionality so it can run multiple strategy orders using ACSIL?


October 12, 2019


Upcoming Webinars and Events
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts