Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi guys been busy on a project so had to let this slide for a while.
I'll put up another example later today/tomorrow to show this but if you cannot wait you use one of these ACSIL functions to reference the array/s in a study on the same chart (scGetStudyArray) and/or different chart(scGetStudyArrayFromChart) and place the array/s you want to use in a SCFloatArray or Subgraph in your new Study.
sc.GetStudyArraysFromChart()
sc.GetStudyArraysFromChartUsingID()
EDIT (sorry about the lack of hyperlink this forum is dropping the end tag off the links??!!)
Thanks a lot for your prompt response Trembling Hand... I will stay tuned for your detailed example and thanks a lot for the thread... Kindly keep it alive here as it is my first day to find it and it has a lot of invaluable information...
Ok here is a quick and dirty example of using the arrays and input settings in a study to use as triggers for events in another study. This could be used for a trading system or another study. Using the requested scsf_HighLowForTimePeriodExtendedLines study it gets the two H/L arrays for the set time period from that study and puts them in local array SCFloatArray and it also gets the end time input for that study to check if that time has passed.
I've just used simple logic to print to the log but it would be the same to trigger for a trade. Basically it checks if the current bar start time is > or = to the ending time set in the HighLowForTimePeriod. Then checks once per bar if the close one bar ago is higher or lower than the H/L in the first study. If so prints out to the log the result.
Things to note.
Of course for this to work you need the scsf_HighLowForTimePeriodExtendedLines study on a chart and reference it as per the screen shot.
When referencing other studies you should set the sc.CalculationPrecedence to LOW_PREC_LEVEL or VERY_LOW_PREC_LEVEL to ensure that the first study has finished doing its calculations before using the values. Also note the logic that makes this study calculate just ONCE per new bar.
No rush at all... Just to let you know , I am patiently looking forward for your follow-up examples regarding importing an on chart-studies data to the trading system... Thanks a lot in advance and have a nice day ...
Thanks a lot for the comprehensive example. sorry, I am new to the forum and for some reason I didn't get a notification update by email. I will study the example, and post questions if any... Once again, thanks a lot for your prompt support and efforts. Highly appreciated indeed!
No have a look at the docs for that function and familiarise yourself with what zero indexing is.
"InputIndex: The zero-based index of the Input to get the value for. The Input index values + 1 are displayed in the Inputs list on the Study Settings window for the study. Example: (In:1)."
Again No. Have a look at what auto looping does in the docs. I covered it in post #8 of this thread but have a look in the docs. Its very important that you understand this - without auto looping you have to programmatically control the array indexes.
int CurrentBarTime = sc.BaseDateTimeIn[sc.Index].GetTimeInSeconds();
if (Result > 0) //If there has been a successful order entry, then draw an arrow at the low of the bar.
{
Subgraph_BuyEntry[sc.Index-1] = sc.Low[sc.Index-1];
SignalString.Format("Buy Limit 1: %.2f & Buy Target1: %.2f & CurrentBarTime: %d", NewOrder.Price1, NewOrder.Price1+ NewOrder.Target1Offset, CurrentBarTime);
sc.AddMessageToLog(SignalString, 0);
}
This is a sample of what is printed in the message log:
How to print the CurrentBarTime to the Message log in <<Date, HH, MM, SS>> format -- I have coded it as above and it prints the time of the bar in numerical value of seconds which is not readable ?
How to print the CurrentBarTime to the Message log in <<Date, HH, MM, SS>> format -- I have coded it as above and it prints the time of the bar in numerical value of seconds which is not readable ?