NexusFi: Find Your Edge


Home Menu

 





Sierra Chart ACSIL syntax for reversal system


Discussion in Sierra Chart

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




 
Search this Thread

Sierra Chart ACSIL syntax for reversal system

  #1 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624

I'm working on a couple stop-and-reverse trading systems in ACSIL and need to figure out how to do a couple things with the code:
  1. Exit all positions by RTH close (i.e. 3pm) or any set time
  2. Not re-enter the market until after a set time (i.e. 5pm)
  3. I think #2 will accomplish this but it also needs to not hold trades over weekends

I'd also like to be able to limit it to RTH only, but it's not really a priority right now. The main thing is to program it to be flat at RTH close and going into the weekends.

I've done some searches on SC and futures.io (formerly BMT) but haven't exactly hit upon what I'm looking for. If anyone can help with the syntax, I'd greatly appreciate the effort.

I'm still VERY new to ACSIL so while stuff like this may be a breeze to others I often have no idea how to codify the concept or action I'm attempting to program. Baby steps

Edit: fwiw, I did post a similar question on SC a month or so ago. SC did reply, but I'm thinking they thought they were responding to a seasoned ACSIL vet. I am not that guy

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
22 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #3 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


I can try to help, can you post the link to your original question on the SC forum? When the strat restarts at 5:00 p.m. will it be starting fresh or resuming previous logic, e.g. reopen 4 units that were closed at 3:00 p.m. and continue trading them?

Also, if you haven't used the spreadsheet for trading studies, then I highly recommend it. Right now I am doing all of my development with them because 1) I can directly see the results of my formulas and the flow of the trading logic which makes the whole process faster and easier, 2) it is easy to create and plot an equity curve on my charts so I don't even have perform backtesting or run a replay, just simply pull up a chart and there it is, 3) I can quickly and easily dump the equity figures or other study data/stats into excel for further analysis.

Reply With Quote
Thanked by:
  #4 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624


vegasfoster View Post
I can try to help, can you post the link to your original question on the SC forum?

@vegasfoster!!! thanks for looking into this, your efforts are greatly appreciated.

as requested, here is the thread from SC:

Time restricted ACSIL trading system - Sierra Chart


vegasfoster View Post
When the strat restarts at 5:00 p.m. will it be starting fresh or resuming previous logic, e.g. reopen 4 units that were closed at 3:00 p.m. and continue trading them?

Excellent question. Ideally, I'd like to actually incorporate that as an option: resume or start fresh. If pressed to pick between the two, I'd say starting fresh.


vegasfoster View Post
Also, if you haven't used the spreadsheet for trading studies, then I highly recommend it. Right now I am doing all of my development with them because 1) I can directly see the results of my formulas and the flow of the trading logic which makes the whole process faster and easier, 2) it is easy to create and plot an equity curve on my charts so I don't even have perform backtesting or run a replay, just simply pull up a chart and there it is, 3) I can quickly and easily dump the equity figures or other study data/stats into excel for further analysis.

Excellent suggestion and ideas. I had mostly been leaning on spreadsheets, but decided it would be worthwhile to start getting into ACSIL given its powerful combination of flexibility and efficiency. This became very noticeable when it came to backtesting: what can literally take hours to backtest via spreadsheet trading system can be done in minutes, sometimes seconds, via ACSIL.

Also, I have to admit that it's been real hit-or-miss for me when it comes to getting spreadsheet trading systems to behave as expected. I'm not opposed to using spreadsheets, it's just that ACSIL has actually been a better experience for me. And I need all the help I can get from these things

Thanks again for checking out the scenario and for your suggestions.

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
  #5 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

Try adding this to your code for a clean start at. End Time would be 3:00 p.m. and Start Time would be 5:00 p.m. Haven't tested, so let me know if you have issues.

 
Code
SCInputRef EndTime = sc.Input[0];
SCInputRef StartTime = sc.Input[1];
		
if (sc.SetDefaults)
{
EndTime.Name = "End Time";
EndTime.SetTime(0);

StartTime.Name = "Start Time";
StartTime.SetTime(0);		
		
return;
}
	
SCDateTime IndexTime = sc.BaseDateTimeIn.TimeAt(sc.Index);
SCDateTime IndexDay = sc.BaseDateTimeIn[sc.Index];

if(IndexTime < EndTime.GetTime() && IndexTime > StartTime.GetTime() && DAY_OF_WEEK(IndexDay) != SATURDAY && DAY_OF_WEEK(IndexDay) != SUNDAY)
{
Rest of your trade logic goes here
}
else sc.FlattenAndCancelAllOrders();

Reply With Quote
Thanked by:
  #6 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624


vegasfoster View Post
Try adding this to your code for a clean start at. End Time would be 3:00 p.m. and Start Time would be 5:00 p.m. Haven't tested, so let me know if you have issues.

Awesome, I'll give it a shot today! Thanks for the effort and happy holidays!

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote




Last Updated on December 24, 2012


© 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