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'm writing from Italy and I'd like to ask something to more experienced Ninja Programmer.
I'm trying to use the Account Object in a Ninja Indicator to create orders on the market.
This means to use i.e. Account.CreateOrders(..........) function.
I've no problem in creating orders (buy/sell/limit/stop), nevertheless I'd like to insert a stoploss order as soon as my order is filled.
I did not find any example on how to do it, neither on how to manage filling.
I'm getting crazy on trying to make the code recognize the position or the filling but no way to make it work.
If somebody faced a similar matter or has examples I'd be very grateful.
I can provide strings of my code if needed.
Thanks in advance to anybody who will answer.
Can you help answer these questions from other members on NexusFi?
I need to insert an order and, if filled, a stop and target orders must be placed on the market.
I tried with you suggestion this way:
The button perfectly insert the buy stop order on the market but, once filled, no message is shown.
I'm a bit confused on the way the stop/target orders should be coded.
Probably they shouldn't be inserted in the OnBarUpdate space?
I've seen the use of the override Plot, but I've never used it so I don't know how to manage it.
You don't have to use the code in the Plot section as I did in the bTPAnaked indicator that I did PM to you. This is just the fastest way to place the orders, but OnBarUpdate should work too.
But have a look at my code in the indicator or in the code in Post#3. This has nothing to do with your code in your last post in OnBarUpdate.
I would start with something like that:
Don't know whether it will work or not, as I don't know how you did code the whole thing (maybe you have to replace the "a" with your "accnt" or "b").