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)
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
Hello
I have a programming question. I am using the Swing indicator built into NinjaTrader to go Long as soon as it is 1 tick above the swingHigh, or go Short as soon as it is 1 tick below the swingLow.
This obviously needs to be done CalculateOnBarClose = false; to enter the trade intrabar
However, now the indicator is being calculated on bar close = false;
I just wanted to know the best way to have a strategy that has the entry for OnBarUpdate when I need:
goLong/goShort-------> needs to be CalculateOnBarClose = false;
Swing(5) indicator--------->needs to be CalculateOnBarClose = true;
Do I create 2 separate methods?
T
here is my code so far:
The only other thing I can think of is use the indicator on the chart and have a FileWriter write the Swing High, Swing Low to a swingLow.txt and swingHigh.txt and then the Strategy uses these .txt files. However, I am thinking this might cause delays, but not sure, etc...
The other way can be using a data structure like ArrayList or something on an indicator page, and then the Strategy page reads the return.
Then the strategy can grab this
BTW, my most comfortable programming language is Java, so it is taking a little while for me to learn C#----not that bad, just trying to relate how things are done differently-----like with get, and set
thanks
Spencer
Can you help answer these questions from other members on NexusFi?
If your "calling" indicator or strategy (the one added to your chart) is set to COBC = false, then anything other than COBC = false in all the child indicators will result in problems. The best thing is to remove COBC from #init altogether, which means it defaults to true, unless the parent is false in which case it defaults to false.
It is not possible to have the parent be different than the child and get correct results. Not in any of my experiences at least.
If you need this, you would have to simulate it yourself. Run everything COBC false, then code a function to simulate filling your dataseries or whatever based on COBC true. I've had to do this several times.
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61
Hi Mike
thanks for the reply. yeah, I think you confirmed my suspicions that this is more complex than I originally thought. I will have to think about this more:-) thanks
The million dollar question I'm trying to answer, and it seems you may be up to something already, is how exactly would I code a function to simulate filling my dataseries?
An example of that would prove very useful to me, I've been straining my brain for a reliable solution for ages...