NexusFi: Find Your Edge


Home Menu

 





Questions and discussion for Sierra Chart ACSIL for Beginners


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one Trembling Hand with 43 posts (34 thanks)
    2. looks_two mosalem2003 with 39 posts (0 thanks)
    3. looks_3 1m1k3 with 20 posts (0 thanks)
    4. looks_4 bradhouser with 6 posts (9 thanks)
      Best Posters
    1. looks_one bobwest with 3.5 thanks per post
    2. looks_two bradhouser with 1.5 thanks per post
    3. looks_3 brach with 1 thanks per post
    4. looks_4 Trembling Hand with 0.8 thanks per post
    1. trending_up 26,716 views
    2. thumb_up 52 thanks given
    3. group 30 followers
    1. forum 118 posts
    2. attach_file 25 attachments




 
Search this Thread

Questions and discussion for Sierra Chart ACSIL for Beginners

  #1 (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: 358

Please post any questions and problems or suggestions you have in this thread about my Sierra Chart ACSIL for Beginners to keep that thread reasonably concise and clean of tangents.



Thanks.

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
26 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
  #2 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,341
Thanks Received: 26,267

I'm really liking this so far. I needed to get off my lazy ass and set up VS instead of Notepad++ so I can do real debugging instead of debug-by-guess. The first few posts were a good nudge in that direction for me.

Your examples are nice and clear, and you've pulled together a number of simple basic things so far from the SC documentation that took me a while to go find and figure out when I started with SC. It's very step-by-step and one step builds on another, as it should.

I think what you're doing will be very helpful to anyone with a little programming experience who wants to get up to speed in SC coding.

I'll definitely be following along.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
  #3 (permalink)
 Grantx 
Reading UK
Legendary no drama Llama
 
Experience: None
Posts: 1,787 since Oct 2016
Thanks Given: 2,826
Thanks Received: 5,058


@Trembling Hand* Thank you so much for doing this.
I seem to remember setting up VS in such a way that you don't need to restart sierrachart whilst doing a build. It is so that you can debug code while being in a live environment which is great for stepping through and verifying variables in real time. Debugging this way does lock Sierra for the duration of the debug process though.

In your next project would you mind working with time functions? For example going back to yesterday at 11:30 and getting the high and low of the prior 2 hours. Or plotting a line 30 points away from the open of the bar at 13:30 for every day.
Just examples but really anything to do with time locations.

Thanks again. I'm looking forward to the next lesson

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
bradhouser
Northern California where the girls are warm
 
Posts: 122 since Nov 2010
Thanks Given: 15
Thanks Received: 72


Grantx View Post
@Trembling Hand* Thank you so much for doing this.
I seem to remember setting up VS in such a way that you don't need to restart sierrachart whilst doing a build. It is so that you can debug code while being in a live environment which is great for stepping through and verifying variables in real-time. Debugging this way does lock Sierra for the duration of the debug process though.


In this order:
1. Analysis>>Build Custom Studies DLL>>Build >> Install Visual C++ Compiler
2. Install Visual Studio. (if you had it installed already before doing step 1, then you need to uninstall it and start over at step 1 or it will not work.)
3. Follow the steps here to Use VS as your IDE and debugger:
https://www.sierrachart.com/index.php?page=doc/StepByStepACSILDebugging.php

When you are debugging and hit a break point, Sierra is locked until you Continue or Stop Debugging.

Reply With Quote
Thanked by:
  #5 (permalink)
 TropicalTrader 
Vancouver Canada
 
Experience: Intermediate
Platform: Sierra Chart
Broker: EdgeClear Rithmic
Trading: MES
Posts: 125 since Feb 2016
Thanks Given: 241
Thanks Received: 552


Trembling Hand View Post
Please post any questions and problems or suggestions you have in this thread about my Sierra Chart ACSIL for Beginners


Thanks a lot for creating this tutorial! Following!

Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
ondafringe
Albuquerque, NM, USA
 
Posts: 124 since Jul 2012
Thanks Given: 87
Thanks Received: 117

Ditto from me... thanks for taking the time to create this tutorial.

Even though I installed everything in the correct order, still couldn't build w/o shutting down SC. Plus, when I did build, got numerous warnings, like 36 warnings (I'm talking about a completely coded study).

So.... just to check...

I copied my cpp file over to ACS_Source, used VS to open the cpp file in that folder, ran the build/debug from SC > Analysis. That seemed to work well and didn't get any warnings. I was up and running and debugging w/o issue... and I didn't have to shut down SC.

Guess I'll continue coding using that workflow.

Again, thanks for helping me get started!

Reply With Quote
  #7 (permalink)
mosalem2003
Toronto
 
Posts: 102 since Apr 2019
Thanks Given: 106
Thanks Received: 23

In the Spreadsheet Trading System , there is inputs to enable trading within time range, i.e

J85 : Allow Trading Only During Time Range (read/write):
J86 :Start Time For Allowed Time Range (read/write):
J87: End Time For Allowed Time Range (read/write):

How can we add these variables to an ACSIL code ?

Reply With Quote
  #8 (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: 358


mosalem2003 View Post
In the Spreadsheet Trading System , there is inputs to enable trading within time range, i.e

J85 : Allow Trading Only During Time Range (read/write):
J86 :Start Time For Allowed Time Range (read/write):
J87: End Time For Allowed Time Range (read/write):

How can we add these variables to an ACSIL code ?

You already have the BarTime variable. Add two sc.input Time values for your start and end time.

Then just do an if statement to check that the current bar time is within the two inputs before proceeding to the nested trade logic statements.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
mosalem2003
Toronto
 
Posts: 102 since Apr 2019
Thanks Given: 106
Thanks Received: 23

 
Code
SCInputRef Input_StartTime = sc.Input[3];
SCInputRef Input_EndTime = sc.Input[4];
 
Code
Input_StartTime.Name = "Start Time";
Input_StartTime.SetTime(0);

Input_EndTime.Name = "End Time";
Input_EndTime.SetTime(SECONDS_PER_DAY - 1);
.....
 
Code
 int CurrentBarTime = sc.BaseDateTimeIn[sc.Index].GetTime();
	
bool TradingAllowed = Input_StartTime.GetTime() <= CurrentBarTime <= Input_EndTime.GetTime();

	if (!TradingAllowed)
		return;
I have used the above code , it compiled successfully but in execution the trading is working independent of start and end time ?

Reply With Quote
  #10 (permalink)
mosalem2003
Toronto
 
Posts: 102 since Apr 2019
Thanks Given: 106
Thanks Received: 23


 
Code
if ( Input_StartTime.GetTime() <  CurrentBarTime    && Input_EndTime.GetTime() > CurrentBarTime)
I used this code instead and it works ...

But not sure why the expression below didn't work though -- should we separate each operand comparison than merging the comparison in one statement as in the above expression that worked ?
 
Code
if ( Input_StartTime.GetTime() <=  CurrentBarTime  <=  Input_EndTime.GetTime() )

Reply With Quote




Last Updated on February 5, 2024


© 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