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)
For example, here is the code snippet to generate one of the buy signals, which at the moment is just an UpArrow. Initially I was thinking you would have to have a parity bit or flag that would trigger to some value upon this arrow being printed. That was the idea behind that variable I have there called "inTrade."
I was thinking I'd add another IF statement outside of that block where the UpArrow is printed to check to see if inTrade==true, and if it is, means we are in a trade so check to see if sell condition is met.
Can you help answer these questions from other members on NexusFi?
That was the idea behind that variable I have there called "inTrade."
I was thinking I'd add another IF statement outside of that block where the UpArrow is printed to check to see if inTrade==true, and if it is, means we are in a trade so check to see if sell condition is met.
Got it!
I did what I suggested above. Problem is that I have to do this for every individual trade scenario I have, and there are over 200 of them.
Here is the code snippet. I added that flag I spoke of above, so that it only triggers AFTER the entry condition is satisfied.
Is there a simple way to add a closing arrow to this? Does NT have some function built in so that once my green/red arrow prints to show my entry, I can plot an exit AFTER that entry arrow?
Asking as eventually I'll want to kick this out to a strategy.
if you convert it into a strategy, it draws arrows for entry and exit for you. You can very this by applying sample strategy ma cross, enable = true and you will see arrows on your chart.
protected override void OnBarUpdate()
{
if (CrossAbove(SMA(Fast), SMA(Slow), 1))
EnterLong();
else if (CrossBelow(SMA(Fast), SMA(Slow), 1))
EnterShort();
}
if you convert it into a strategy, it draws arrows for entry and exit for you. You can very this by applying sample strategy ma cross, enable = true and you will see arrows on your chart.
Excellent!
Since I have it setup when to draw an arrow up, and attached to it already is the exit.... so basically all I would need to do is replace the logic for drawing the arrows and the text I have with the "EnterLong()/EnterShort()" short commands?
Is there a command for exiting the signals, or do you just enter "EnterShort()" to exit a long trade for example?
Also, when I do create a strategy for this, if I have over 200 individual setups that I want to collect statistics for individually, do I have to individually toggle them on/off in the script and then test? Or will that be taken care of in the "signalName" parameter in the EnterLong()? Or is "signalName" just for visual reference on the chart?
For example, here is the code snippet to generate one of the buy signals, which at the moment is just an UpArrow. Initially I was thinking you would have to have a parity bit or flag that would trigger to some value upon this arrow being printed. That was the idea behind that variable I have there called "inTrade."
I was thinking I'd add another IF statement outside of that block where the UpArrow is printed to check to see if inTrade==true, and if it is, means we are in a trade so check to see if sell condition is met.