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)
I want to keep a de-coupled architecture, and send an instant trade alert to a running strategy from an indicator.
I want to have one strategy listening for signals from multiple indicators or other strategies. This way I can concentrate the trade management in just one strategy.
I have a static global array working, but then the strategy needs a timer to watch for input.
Would rather just have the indicator send the signal direct to the strategy.
Any suggestions, samples?
How would the strategy "register itself" in the indicator, so the indicator could communicate?
Many thanks
Can you help answer these questions from other members on NexusFi?
Why would you do the order management in a strategy and be stuck to one instrument ?
you could have a small stand alone process outside NT that is listening for the triggers,
and if you like, then create an order through the ATI interface, but keep the order mgt
completely outside of a strategy running.
the strategy is BAD anyway, you close manual an order, the strategy and all it's objects
get resetted, not a good idea for something that will hold you logic...
Well, there would be one strategy running for each instrument. And somehow the indicator would need to match/sync to the strategy with the same Instrument.
I'm not a C# guy or a .Net guy....don't have enough skill to have something "outside" of NT setup.
Yes, I don't like the way the Strategy base is designed in NT...that NT disables the strategy when even a non-attached Chart ATM is closed.
I already do order management in an indicator with OIF. But there are lots of disadvantages to doing this, one being that the backtesting is not integrated with the strategy stats, et cetera. And, no prototypingwith the Strategy Analyzer.
You can try using named pipes with objects like NamedPipeClientStream, coding in C# is required but it's not very hard.
Your strategy can listen to this pipe(s) and act depending on what is received.
On the other side indicators or strategies can send "something" to this master strategy.
I was playing with TCP before and it might work...I could assign an instrument to a single port in the loopback and then have that be the matching between indicator ??
this would allow more than one instrument, each instrument having one strategy and possibly multiple indicators talking to it over a singe port
have not looked at named pipes yet....
But, was hoping for something simplier...like
.... having the indicator trigger an event in the (decoupled) strategy
What you can do is:
- in the strategy
-> create a "service" thread
-> this service thread will read what's coming in from a namedpipe
-> if it's for a new instrument create a new thread with a new namedpipe for this specific instrument (which will be the same as the sender's namedpipe)
Then you can play with events in each threads to buy/sell or whatever you want.
I did something like to hedge two different accounts positions, it worked well, you can use the same kind of logic.
In fact there is more simpler than pipes with TriggerCustomEvent().
You can check this example:
- the indicator TransferToStrategy contains the entry/exit logic (very private algo: buy if bar is up, sell if bar is down )
- the TransferMaster strategy is executing orders signal sent by the indicator
- the TransferSlave strategy is executing orders signal sent by the indicator (which is the opposite of the what TransferMaster sent)