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)
someone might be able to help you, if you could elaborate what you are trying to accomplish.
A correct answer to your question (although obviously not what you want) would be:
This would be the code re-written, without using next bar - taking your question literally.
As another person usually doesn't know your intend, it's extremely helpful to provide as much context and explanations as possible - what does the code do now, what do you want it to do instead etc.. If you want people being able to help you, it can also make sense to state the platform you want the help for and post into the correct section of the forum.
Just to make it clear, I am trying to help and the above is meant as that and no criticism.
When you apply the following code (in a signal) to an intraday chart, you will see why the two are different:
Date <> Date[1] will become true on the first bar of the new day, while Date next bar <> Date is true on the last bar of the current day already (as at that time the date of the NEXT BAR is already the next date).
One approach might be to change the codes that are affected by that, so they give you the same results when using Date <> Date[1].
what exactly do you mean with "still referencing the 30M logic" exactly? What should it apply to and what not?
If you are running your strategy without intrabar order generation on a 30 min chart, you have access to the values at the end of that 30 min bar. This is something you can't overcome, unless you are willing to act on values that might be different than they would be at the end of the bar. Take the average for example: Over the course of the bar it will have different values. Your current signal acts on the end of bar values for that average, but if you are trying to act on the average's values already mid bar for example, the results will likely be different than in your original strategy (simply because you are looking at different data).
You also might want to do @BigMike a favor and not post the same questions multiple times across different threads.
I did not want to scare readers by posting a large amount of code so I tried to keep it as simple as possible. It backed fire on me. Anyhow, you have helped me out a lot and I think that I got a temporary solution. Before I was attaching the code to the 30M chart, using the code below I am attaching the code to 1M chart. This is what I mean by using 1M chart but referencing 30M chart.
you are welcome. You might want to specify that the average should use the Data 2 Close, although for the closing price this might not even matter (for High and Low for example it will, though, as these will be different).