Support Board
Date/Time: Wed, 27 Nov 2024 13:00:04 +0000
[Programming Help] - ACSIL Evaluation function
View Count: 346
[2023-08-06 17:30:06] |
User373245 - Posts: 42 |
Is there a function to evaluate when alert condition is true in ACSIL automated trading over evaluate at the end of the bar. I built my entry as signal from grabbing the ID label from an already built color bar based on alert condition(I think I got the iteration correct in the array??) It compiles anyway....I built it out to =1 and =-1 on the buy and sell and have not built the BuyEntry or SellEntry out yet. Im not sure if the array iteration within the alert signal would be the processing(I am new to engineering!) Or do I need to build an input reference based on a function that evaluates when the alert is true.
|
[2023-08-06 17:36:22] |
User373245 - Posts: 42 |
How to you use the function of getting the user to input yes or no. SCInputRef Input_Enabled = sc.Input[0]; Input_Enabled.Name = "Enabled"; Input_Enabled.SetYesNo(1); I tried Input_Enabled.GetYesNo(); over Set but could not get it to work. I also tried Input_Enabled.Name = "Enabled"; Input_Enabled.SetYesNo(1); Input_Enabled.GetYesNo(); the example of get is to built an int and name.GetYesNo() and tried a couple variations of this as well and was not able to succeed??? |
[2023-08-06 17:55:47] |
JohnR - User831573 - Posts: 306 |
Could it be that you are trying to use the SET outside of the sc.SetDefaults section of code? ACSIL Interface Members - sc.Input Array: sc.Input[].GetYesNo() in Intro section near bottom of desc ------- Use the Set* functions in the sc.SetDefaults code block to add an Input to a Study and set its initial value. Use the Get* member functions outside of the sc.SetDefaults code block to get the current Input setting. ------- Also, once you have the Input 'set' within the SetDefaults section of code, then within your 'Do Data Processing' section you would use the 'get' like this. // Calculate a simple moving average from the base data sc.SimpleMovAvg(sc.Close,Average,Length.GetInt()); I prefer not to use the Get over and over, and usually on Bar 0 or Full Recalc, I will set the input to a persistent var. Hope this helps JohnR Date Time Of Last Edit: 2023-08-06 18:08:38
|
To post a message in this thread, you need to log in with your Sierra Chart account: