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 am creating a custom strategy that utilizes two orders. The first (Entry A) has a fixed profit target and the second (Entry B) is managed only by the Stop Loss.
When Entry A hits its profit target, then the stop loss for Entry B is moved closer to the price. Specifically it will look like this:
"When Entry A hits profit target, move Entry B Stop Loss to (Entry Price - (Profit Target - Entry Price))."
When Entry A closes at 60, then Entry B Stop loss is then moved to 40.
Currently, this is what I have:
As far as I can tell, that should set the initial stop prices for both orders and create the profit target for Entry A.
What I need now is to figure out how to determine if Entry A has closed at the profit target and then tell NinjaTrader to move the Entry B stop to its next price.
My problem:
I can not figure out how to tell NinjaTrader to check if Entry A has closed at Profit Target
I can not figure out how to tell NinjaTrader to move the Stop Loss for Entry B
Finally, when that happens, the stop loss will need to do one more thing. When an indicator, let's assume SMA, is above the Entry B Stop price, I want the stop order to trail the SMA. I would assume that I would do something like this:
if (SMA > StopPrice + ???)
{
SetStopLoss("LongEntryB",CalculationMode.Price,SMA-???);
}
I would like this to update at every bar.
I assume that I would need to create a variable for "StopPrice".
Naturally, I would like the stop loss to only go up. How do I insure that it does not re-set the stop price to a lower price if the SMA starts going down?
I know that this is a lot in a single post - sorry for that. I just assumed it might be easiest to get all of my questions out at the same time.
I appreciate the help that anyone is able to give.
Can you help answer these questions from other members on NexusFi?