Support Board
Date/Time: Sun, 09 Mar 2025 21:05:40 +0000
[STRATEGY][AUTOMATE] How to automate my strategy into Sierrachart ?
View Count: 1285
[2022-03-04 12:13:05] |
noaah - Posts: 32 |
Hey there, Just entered into the savage world of automatic trading and im struggling about defining trading conditions based on my studies. I attached to this ticket a pdf where I explain what I want to do. I dont know if what I want is even possible or extremely difficult to do automaticaly, I dont realy ask you to do it all for myself if that is difficult but I think Im speaking here with sierra experts who for sure are pro about this tool and are the best to at least indicate me a way to do that with some big helps or at least telling me if what I want to do is possible. If you got more questions about it ask me, I let you read this PDF and tell me what you think about it. Thanks a lot for your help and your great trading plateform :) |
![]() |
[2022-03-04 12:28:09] |
1+1=10 - Posts: 270 |
Yes this can be automated. See this thread for the options, especially the first 2 choices in post 3: Automated Trading |
[2022-03-04 12:32:17] |
noaah - Posts: 32 |
Thanks for your answer ! Yes I think Im going to make it with the Advanced Custom Study ASCIL Advanced Custom Study Interface and Language (ACSIL) but I really dont find what I need to have to do my automation in the doc :(
|
[2022-03-04 12:40:39] |
1+1=10 - Posts: 270 |
Do you know how to program? Otherwise, you’ll have to hire a programmer to write an ACSIL trading study for you. If not, you can use one of the first 2 options in post #3. |
[2022-03-04 12:43:08] |
noaah - Posts: 32 |
Im a programmer (php, js, c+ etc..) but my problem here is find variable names like how to get the value of the last candel, the lenght of it wick etc..
|
[2022-03-04 12:53:50] |
1+1=10 - Posts: 270 |
The ACSIL api docs are extensive. The order in which the links are presented here is a fairly useful order to read then in for beginners: Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL)) |
[2022-03-04 15:32:03] |
ForgivingComputers.com - Posts: 1021 |
Im a programmer (php, js, c+ etc..) but my problem here is find variable names like how to get the value of the last candel, the lenght of it wick etc..
Just about everything you are looking for will begin with sc. or SC_ or SC telling you it is part of the API. For example: Value of Last Candle: float LastPrice = sc.BaseData[SC_LAST][sc.Index];
Length of upper wick: float UpperWickSize = sc.BaseData[SC_HIGH][sc.Index] - fmax(sc.BaseData[SC_OPEN][sc.Index], sc.BaseData[SC_CLOSE][sc.Index]);
sc.BasaData is a two-dimensional Array with the OHLC of the bar, and sc.Index is the number of the bar, starting with 0 at the left of the chart. The c:\sierrachart\acs_source folder has copies of the source code used to make almost all of the studies available with vanilla Sierra Chart. You can learn a lot by walking through some of the examples. Note: The search function on the website is not the best, you are often better off searching Google with "site:sierrachart.com" along with your search string. |
[2022-03-04 16:11:30] |
noaah - Posts: 32 |
Yes thanks a lot for your help ! Do you know someone I can pay for making my bot ? I dont know where to ask this :)
|
[2022-03-04 16:16:35] |
1+1=10 - Posts: 270 |
These programmers seem to be active: 1. https://www.simplesystemtrading.com/?link=x (active -- here's his twitter: https://twitter.com/sstfrederik) 2. https://www.fiverr.com/synergy0911/create-any-trading-code-for-ninjatrader-tradingview-mt4 (it says SC ACSIL in as profile when you scroll down) 3. https://www.upwork.com/freelancers/~01e7a1b7a2edd4853a/ 4. https://forgivingcomputers.com/ Having said that, you really should try some of the non-programming methods in SC for automated trading especially because your strategy is very simple: Spreadsheet Systems, Alerts and Automated Trading: General Information |
[2022-03-04 17:04:14] |
noaah - Posts: 32 |
Thanks you really for your help ! You are a good !! Well yes I already saw that but I wasn't sure I can do it with that. You speak about the spreadsheet formulas, not the Trading System Based on alert ? I got to take a look at it, really dont know how it works. |
[2022-03-04 17:32:37] |
1+1=10 - Posts: 270 |
You could actually do it with either the Alerts or Spreadsheets.
|
[2022-03-04 18:23:25] |
noaah - Posts: 32 |
Super, Im on it ! Do you have an idea about determinating the candel's wicks size ? I dont find anything about it in the Spreadsheet Systems, Alerts and Automated Trading: General Information page |
[2022-03-04 19:22:46] |
1+1=10 - Posts: 270 |
The link I previously sent wasn’t ideal. Ok, if you want to use alert formulas like: =AND(C>C[-1], V>V[-1]) which selects all bars where the bar’s close > previous bar’s close AND the volume > precious’s bars volume, as an example use: Study/Chart Alerts And Scanning You can input your aforementioned formulas into a ColorBarOnAlert or ColorBackgroundOnAlert study to show which bars match your formula: Color Bar Based on Alert Condition As the alternative of learning how to use a spreadsheet for trading, see the links here: Table of Contents | (Spreadsheets) You’ll notice everything you need is somewhere in the documentation. When I was learning how to use SierraCharts I read all of it and tried various things out. It will take you a week or so but you’ll move much faster in the future. |
[2022-03-04 19:42:12] |
Sawtooth - Posts: 4181 |
If you don't want to use ACSIL, IMO the Spreadsheet System for Trading study would be best for your automated strategy. Here are some quick spreadsheet formulas: Upper wick size: =C3-MAX(B3,E3) Lower wick size: =MIN(B3,E3)-D3 =Candle range: =C3-D3 Body size: =ABS(B3-E3) Upper wick/candle range %: =(C3-MAX(B3,E3))/(C3-D3) Lower wick/candle range %: =(MIN(B3,E3)-D3)/(C3-D3) -where the OHLC are B3,C3,D3,E3 Enter these formulas in row 3 of a Formula Column to the right of the entry/exit columns (O3 and rightward). Here are some spreadsheet formula examples: Spreadsheet Example Formulas and Usage This one in particular, to determine the bar's color: Spreadsheet Example Formulas and Usage: Formula that Matches the Coloring of Up and Down Price Bars |
[2022-03-04 19:57:10] |
noaah - Posts: 32 |
Thanks for your help ! Im going so much faster with your help, really appreciate it !!!
|
[2022-03-05 01:53:52] |
noaah - Posts: 32 |
With your great help I achieve all my conditions ! An infinite thanks to you guys ! Im now blocked at the (I hope) last step: determining when the bot Buy ! I got a lot of conditions for it to buy so I enter this formula under buy entry (in K3): =IF(AND(O5=1,X5=1,T5<>0,O4=1,S4<=35,T4<>0)) It give me a #ARGS! error, I think that is because I miss the last part of the IF where I give the result of conditions, but here the result if all theses conditions are meet is that I just want to buy market, do you know how to tell it that ? EDIT: Im sorry I ask but I just found out the solution, I just need to add =IF(AND(O5=1,X5=1,T5<>0,O4=1,S4<=35,T4<>0),1,0) the 1 for True and 0 for false at the end I think ! Date Time Of Last Edit: 2022-03-05 01:58:57
|
[2022-03-05 03:06:36] |
Sawtooth - Posts: 4181 |
If you only want a 1/0 then you don't need to use the IF function: =AND(O5=1,X5=1,T5<>0,O4=1,S4<=35,T4<>0) Although either will work the same. |
[2022-03-05 11:02:43] |
noaah - Posts: 32 |
Yes thanks thats work ! Last part where I struggled is to Buy exit and Sell exit, my conditions doesnt trigger, never :( I put this for Buy exit: OR(AND($J$8 > 0, ID0.SG4@$3 <= $J$9-4), AND($J$8 > 0, ID0.SG4@$3 >= $J$9+1)) To Buy exit when I hit -4 or +1 I dont know why it never trigger Possibily because im on replay mode ? Date Time Of Last Edit: 2022-03-05 11:14:48
|
[2022-03-05 13:26:18] |
noaah - Posts: 32 |
It tell me 0 in each cell (it have to tell 1 if he exit) but when I look the bot its looks like it Buy Exit and Sell Exit well, I really dont understand
|
[2022-03-05 14:08:02] |
Sawtooth - Posts: 4181 |
Your formula works for me: =OR(AND($J$8 > 0, ID0.SG4@$3 <= $J$9-4), AND($J$8 > 0, ID0.SG4@$3 >= $J$9+1)) Using the Low and High might be better: =OR(AND($J$8 > 0, ID0.SG3@$3 <= $J$9-4), AND($J$8 > 0, ID0.SG2@$3 >= $J$9+1)) - AutoTrading must be enabled, both Chart and Global. - J28 must be 0 or blank. - For intrabar exits, 'Signal Only On Bar Close (L,N-Z)' needs to be No. Note: Using only L,N for exits means your position is naked in the market. I use the Trade Window's Attached Orders for targets and stops. They are OCO and server-side (assuming your acct has that capability). I only use L,N for ancillary exit conditions, and if used with Attached Orders,'Cancel All Working Orders On Exit' must be Yes. |
[2022-03-05 14:19:38] |
noaah - Posts: 32 |
Thanks for your help ! Well it looks like the exit trades or made but what make me ask this is because the L and N columns are full of 0 and there is no 1 in (the 1 that mean okay the bot exit this trade). I attache here a screenshot, you can see I got here a Buy entry but no Buy Exit (it may have been triggered since I hit the +1p) Date Time Of Last Edit: 2022-03-05 14:26:38
|
![]() |
[2022-03-05 15:11:13] |
Sawtooth - Posts: 4181 |
L and N columns are full of 0 and there is no 1
This is because you are referencing J8, which is current only and has no relationship to previous bars.Before the Close price touches your J9 offsets, columns L,N are all zeros, and the moment after the Close price touches your J9 offsets, columns L,N are also all zeros. Columns L,N will be filled with 1's for only a flash when the Close price touches your J9 offsets. If you want historical exit arrows on bars where the exits would have occurred, and you are using intrabar exits, you'll need to reference the High and Low instead of the Close, and you'll need to create a persistent variable of every entry price so that you can use it instead of J9. This is more advanced, and beyond what can reasonably be shared in a forum post. I notice the N3 formula in your pic has a mistake: =OR(AND($J$8 < 0, N4ID0.SG4@$3 >= $J$9-4), AND($J$8 < 0, ID0.SG4@$3 <= $J$9+1)) |
[2022-03-05 15:17:30] |
noaah - Posts: 32 |
Okay I think I see now, thanks a lot im going to take a look at it, you speak about more advanced but dont look that complicated to do no ? My only problem is that I dont have columns lefts for making more persistent variable but.. I will find ! Can you take a look at my problematic here ? Sierrachart Data Download from the largest period of time You look like having such a great level, you might can help me easily with that question I think! Thanks a lot !! |
[2022-03-05 15:25:08] |
Sawtooth - Posts: 4181 |
My only problem is that I dont have columns lefts for making more persistent variable
You can set the 'Number of Formula Columns' to a max of 60.
|
To post a message in this thread, you need to log in with your Sierra Chart account: