How to abstract a functionality so it can run multiple strategy orders using ACSIL? - Sierra Chart Programming | futures io social day trading
futures io futures trading


How to abstract a functionality so it can run multiple strategy orders using ACSIL?
Updated: Views / Replies:201 / 3
Created: by doetrader Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

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

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

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

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
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Merida, Yucatan, Mexico
 
 
Posts: 103 since Nov 2010
Thanks: 14 given, 57 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
 
  #4 (permalink)
Denver Colorado/USA
 
Trading Experience: Intermediate
Platform: SierraChart
Broker/Data: AMP
Favorite Futures: Bonds
 
LittleFinger's Avatar
 
Posts: 99 since May 2017
Thanks: 104 given, 106 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#scBaseDataIn

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:

Reply



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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Webinar: The Seven Most Effective Trading Setups w/Peter Davies @ Jigsaw

Oct 17
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestions on using multiple monitors when trading multiple instruments Rad4633 Tech Support 46 November 9th, 2014 06:08 PM
Instructional videos about ACSIL with Visual studio and other ACSIL programming t yonatan Sierra Chart Programming 2 January 29th, 2013 02:34 PM
Using GOM Recorder functionality for own indicator crez The Elite Circle 2 August 1st, 2012 06:50 AM
Webinar: X_Trader Functionality Overview & Q/A bobk Trading Technologies 30 August 21st, 2011 06:08 PM
Sync-ing functionality - views? drolles NinjaTrader Programming 1 February 7th, 2011 06:27 PM


All times are GMT -4. The time now is 09:56 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 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