NexusFi: Find Your Edge


Home Menu

 





How to organize custom trading study?


Discussion in Sierra Chart

Updated
    1. trending_up 2,277 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

How to organize custom trading study?

  #1 (permalink)
 skellington 
San Jose, CA
 
Experience: Intermediate
Trading: Futures
Posts: 32 since May 2021
Thanks Given: 36
Thanks Received: 37

Hi,

I'm building a custom trading study in Sierra Chart, but this is the first time for me and I have some general questions about the best way to organize things if anyone with ACSIL experience can point me in the right direction.

What I'm trying to do is:

- Build entry/exit logic via multiple indicators (currently 12 indicators for entry/exit)
- Build order logic that can track N number of contracts with multiple different exit/stop conditions (for example: buy 4 contracts market, sell 2 @ 1st target price, sell 2 @ end of trade condition), stop logic may come from indicators or trailing stop, but either way it will be updated continuously while in a trade
- Draw a bunch of custom system status graphics into the main chart
- Maybe have some interactive buttons in the chart to control some top level features of the system like a "SendTradesToBroker" toggle or a "FlattenAndDisable" button.

My questions are:
  • Is it better/normal for studies to refer to other studies through setting inputs in Study Settings by the user OR is it better/normal for a study to directly call other study code from inside the study?

    Obviously having a user defined input is good when they are expected to have the flexibility there, but what if my study uses specific indicators so there is no need to make it assignable?

    Since my trading system uses so many indicators, I'm not sure I want to force a user to first add 12+ indicators to a chart and then to hand assign them in the Study Settings to 12+ inputs in my study.
  • What is a subgraph vs just a graph? Why does it seem like everything is a subgraph? Is the "main" graph just the graph in region 0 of the chart?
  • Given that I want fine control of the order management (bracket order, scaling out, custom trailing stop logic, handling partial fills or fills at multiple prices), can I use the "automated trade management" stuff, will it handle the flexibility I'm looking for, or do I need to use the "unmanaged automated trade" stuff?

The ACSIL stuff looks powerful, but knowing the best practices takes time and experience.

Thanks!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
 
  #2 (permalink)
 skellington 
San Jose, CA
 
Experience: Intermediate
Trading: Futures
Posts: 32 since May 2021
Thanks Given: 36
Thanks Received: 37

OK replying to myself...

One thing I learned from playing with it last night is that, from ACSIL, you can't create ACSIC code internal indicators/studies and have them show up in multiple regions (a study can only draw in one region). So, if you need a bunch of indicators/studies and want to see their full subgraphs rendered, you can't do that if you create them in code. (Technically, you CAN do it, but if the ranges of the indicators/studies are wildly different you'll get an unreadable subgraph since they will all be jammed into the same region.)

There is a workaround involving having the user of the study add StudySubgraphReference studies to the chart that reference subgraphs in your custom study, but draw their data into the StudySubgraphReference region set by the user. This is probably more awkward then just assigning inputs in your custom study to manually added indicators. This isn't very user friendly, but it works.

This is a bit of an irritating limitation which would easily be solved with the concept of subregions (heirarchical regions) so that a study can define subregions that are attached just below the study wherever the user set the study chart region. But it can be worked around, so that's fine.

Lastly, it doesn't look like you can create a user made study in code like you can with a built in like sc.SimpleMoveAvg(). I don't see any way to add studies to the sc StudyInterface.

Started this thread Reply With Quote
  #3 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360



skellington View Post
Lastly, it doesn't look like you can create a user made study in code like you can with a built in like sc.SimpleMoveAvg(). I don't see any way to add studies to the sc StudyInterface.

I'm not 100% sure what you mean but you can reference any study.

Follow me on Twitter Reply With Quote
  #4 (permalink)
 skellington 
San Jose, CA
 
Experience: Intermediate
Trading: Futures
Posts: 32 since May 2021
Thanks Given: 36
Thanks Received: 37

As far as I can tell, you can't compute values from a custom study directly through a function call like you can with built-ins like:

sc.SimpleMovAvg(result, Subgraph_SimpMovAvg, sc.Index, 5);

You have to add it to the chart and reference it.

Started this thread Reply With Quote
  #5 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360


skellington View Post
As far as I can tell, you can't compute values from a custom study directly through a function call like you can with built-ins like:

sc.SimpleMovAvg(result, Subgraph_SimpMovAvg, sc.Index, 5);

You have to add it to the chart and reference it.

You can if you write it as a function properly.just like any sc method.

sc.SimpleMovAvg()
So to be clear this isn't a study its a function. If you want the same in a custom function you have to write a function not a study.

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on June 24, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts