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)
hi
I currently run a simple automated strategy using MT4, and I want to try & replicate it in NT4, so that I can backtest and refine some of the variables. I'm having difficulty replicating the profit target in the condition builder (i'm don't have a developers mind Im afraid)
In a long position:
if the current bar is the trigger bar, I want to buy on the next bar if it breaks x pips above the trigger bar (complete)
I then want to establish a stop loss that initially is set below the trigger bar by x pips
I also want to establish a profit target based on the range of the trigger bar - say initially 100%
Stage 2 is then to split the order & take the first lot off after 100% of trigger bar is reached & x% after that
So far I have created the low & high of the trigger bar as user variables, but not sure how to apply these to the setstoploss and setprofittarget in the condition builder. If I can achieve this, I could then move onto Stage 2.
Any help at this stage gratefully received - even if someone says "go get a programmer to develop it"
Michael
Can you help answer these questions from other members on NexusFi?
I've never used the strat wizard, but I had a quick look at it. When you're on the window defining stops/targets, in the parameters box, next to 'values', on the right hand side there's a small box with some dots in it. Click that - it gives you access to user variables.
Thx Xeno: in the end I watched Mike's video & have started to attempt to modify that. The main difference is that i wanted to set targets based on %'s rather than just ticks, & then have entered on a stop order (next bar) rather than market order. I gave up on the % entry idea for now, as it seems a bit beyond me, but the rest seems okay, with a couple of exceptions:
Shorts: b/e doesn't move up after 1st lot, but does move up after 2nd
Longs: b/e does move up after 1st, but the 3rd lot doesn't move
I think, if they are doing different things, I have been staring at the screen a little too long. Not sure if anyone can have a quick look, I suspect it is something very obvious.
I think doing a quick c# (and Ninja Script) tutorial would help. You have all sorts of stuff that is not quite right. Some that occur to me at first glance:
- you probably don't need to be declaring things like smav1 everywhere you assign them
- your three SetStopLoss lines do the same thing - they have the same parameters, just a different label (set TraceOrders = true in Initialize()) (same applies to enter short and long stop lines)
- in ManageOrders() your breakeven3 lines are executed regardless of position (long or short) because you've terminated the if with '}' after breakeven2. Your breakeven3 lines are surrounded by meaningless {} You need to look up how 'if' works.
I basically wanted to test a simple 3 profit/stop system using an on-stop order system that buys above market. The stops would move to b/e once the 1st lot had been achieved. I wanted this in 2 ways: - one based on fixed ticks (say, 20, 40, 60) & one based on percentages. Say 100, 200, 500% of previous bar ranges.
I have used this system manually on day trading swing charts for ages; I would have thought it was fairly easy to setup or that it had already been setup somewhere. It was the entire reason for me looking into NT, as if it could be setup in the condition builder I had enough nous (hopefully) to establish my own patterns, price action rules etc. I use very few indicators in my trading.
I have had various replies that I should set it up myself (don't have coding background with enough experience) or that it is too difficult to set up in condition builder, but I had thought it would have been developed somewhere. Maybe if I join Elite I might find it there?
Thanks for help.
Michael
BTW, not sure what last post was, something bout scaling & being wrong is this a reference to my trading or my coding?
I think it's unlikely it exists in the elite section, but you should probably still join up ;-)
The reason it probably doesn't exist is that it's a very simple strategy, that probably won't make money. You say you've used it manually for ages. Does it make money consistently? Can you honestly say that you've followed the rules you intend to code 100% accurately, with no discretion? Are the levels going to be fixed, or are you changing them every day based on some clever analytics (which could then make your system profitable)
Sorry to be rather negative, but people who have coded and tested lots of systems would probably tell you a similar thing.
(regarding the scaling post - I think he means you shouldn't code a strategy that does scaling - i.e scaling into and out of positions. Personally I don't see why you shouldn't, I'd be interested to know why he thinks that)
In this video tutorial I show how to create a strategy from scratch (not using the wizard, which I never use).
The strategy contains a few optimizable parameters such as SMA length, EMA length, HMA length, three different targets with custom tick settings …
.
Instead of fixed size tick, I wanted %'s of previous ranges & I wanted to buy above market onstop, rather than just entry order. It was really just the entry/exit strategy around which I would create my own price action strategies. I've been running a hedge fund around such things for years, just really wanted to see if some of my systems could be automated.
Thanks for your input, I'm sure a man of your calibre could knock it up in 5 mins
hey Mike
Wondered if you read this whether you could comment; I've developed a simple strategy using your video as the backbone - 3 simple take profits with a simple feature. I'm not worried about profitability here, I'm worried about the tendency, seemingly randomly, for the code to work & then not.
The stop is supposed to move to b/e once targets are hit, which most of the time it seems to accomplish. There are however certain times when for no apparent reason, it doesn't do as it should. So far, Ninja Support haven't been too helpful so I thought as the title suggests, I would go to the butcher and not the block.