(If you already have an account, login at the top of the page)
futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.
At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.
With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.
We are fundamentally different than most other trading sites:
We are here to help. Just let us know what you need.
We work extremely hard to keep things positive in our community.
We do not tolerate rude behavior, trolling, or vendors advertising in posts.
We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
We expect our members to participate and become a part of the community. Help yourself by helping others.
You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple.
I am trying a way to continously monitor a bar for certain conditions and then executing a trade once that condition has occured. Unfortunately i cannot find examples of how to implement/facilitate this without either freezing up sierra due to what i can only assume is a massive amount of memory leaks caused by a self repeating while loop.
But if you have autoloop=1 on, then basically once you reach the end of the code it ends and essentially reboots when there is a function call (a new bar opening, current bar closing etc). So if you use an if statement and the conditions are not met then that trade is never going to be executed from what i understand, even if the conditions are met lateron while the bar is forming.
To the point:
This is essentially what i need to happen but this leads to memory leaks.
Now if you try this
It actually works but not in the way youd expect them to.
To be more specific i am dealing with Flexrenkos here, and if you use larger settings like 32-31-30 for ES or YM then obviously those retracebars (long wick bars) can last forever, to see what i mean you can look at Outlanders Flexrenko Day Trading Thread.
So what i need is some form of loop that checks whether or not the bar has not closed yet that will not lead to sierra freezing.
I'm open to suggestions or pointers towards ACSIL member functions i should be using.
Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.
It evaluates in real time by default, you don't have to tell it to do that. Autoloop should equal 1 unless you are controlling the indexing, which it doesn't appear you are. Also, there is a tradingsystem.cpp file you can look at that has a bunch of examples in it.
setting autoloop = 1 means that for every function call (new bar) the code will be repeated. This doesnt change the fact that if you have something along the lines of the crossover example in an if statement for executing a trade that it should not be executed if the conditions are not met.
If the If statement is not executed then the program ends at that point and has to wait being reloaded once a new bar pops up.
So this is why i thought about using a while loop, because a while loop will not terminate until the condition stops being true, this way you can do stuff like execute trades and monitor the bar while it has not closed yet. Unfortunately as you may imagine at this point the while loop needs to end and given the way its structured its going to repeat in an infinite loop right now.
So either i am dead wrong or ill have to try and rewrite the if statement and see if that works later on. In which case i would be very confused because as far as i understand the matter: If statements are skipped if the condition is not met. So in my case wouldnt it simply be skipped?
As for the tradingstudies.cpp file... almost all examples in there (from what ive seen) execute trades after a bar has closed and not while the bar is still open.
So how do i perform a condition check while a bar is still open, where the condition is not met yet, but may be met 2-3 minutes later without terminating the program and awaiting a function call
The study function is called every time there is new trade data or bid/ask data, so by default it is called many times while the bar is still open. See Working with Arrays and Looping - Sierra Chart. You don't have to do anything special to check for crossover intrabar. @vegasfoster is correct.
I have a similar problem. I have an exit condition that seems to be verified only when the next bar appears which of course causes exits way beyond my exit condition. The higher the time frame the worse the execution.
I use:
if (sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_NOT_CLOSED) return;
At the Beginning of the dll function.
If I disable it the results are getting worser while Backtesting via Auto Trade System Bar Backtest.
When I use Replay (wich takes a lot more time) the execution is precise.
If I use Target and StopOffset the execution instead of my own exit condition it is also correct, but I want to use my own created exit conditions.
Will stop any code from executing below it so is probably not the right way. But it's hard to tell without you posting more code to see what is happening.