How to cluster multiple enry or exit conitions into one?
Author: mikesblack
Creation Date: 11/29/2012 11:50 AM
profile picture

mikesblack

#1
Hi- I was trying to figure out how to cluster multiple conditions,e.g. if (roc[bar-4]<-4&&rsq[bar]|| other conditions... and so on, and just call that cluster condition A. So that if I write if condition A then- buy or sell etc, what would be the proper syntax for this? Thanks very much M.
profile picture

Eugene

#2
Define a method accepting a bar and returning boolean variable (true/false)?

CODE:
Please log in to see this code.


CODE:
Please log in to see this code.
profile picture

mikesblack

#3
CODE:
Please log in to see this code.


Thanks Eugene-

What to write in the case where a sell signal would specify that cluster A is false? e.g.- If cluster a is false and other conditions then ExitAtMarket(bar+1);

or
Is there a better way to specify sell only if conditions for buy are not in effect?

Thanks
profile picture

Eugene

#4
QUOTE:
What to write in the case where a sell signal would specify that cluster A is false? e.g.- If cluster a is false and other conditions then ExitAtMarket(bar+1);

Mike, are you sure you have browsed at least the first few dozen pages of a C# 101 book? You can't do even basic scripting on your own w/o knowing relational and logical operators. I'd highly suggest checking this out:

How do I start with C# ?
profile picture

mikesblack

#5
Indeed I have. I am confused, ( or perhaps overwhelmed) integrating W.L. specific from general knowledge of programing(C#). My apologies for my question that is or seems most academic. I realize I would be frustrated having to answer user questions that are in such a way so basic. I also do not wish to demonstrate my ignorance, and embarrassing myself by posting publicly this way.

I use WL daily with real money on the line and so naturally I would enjoy expanding my capabilities even beyond basics and I don't wish or expect you to use your time teaching me the "ABCs" of C#.





profile picture

Eugene

#6
QUOTE:
What to write in the case where a sell signal would specify that cluster A is false? e.g.- If cluster a is false and other conditions then ExitAtMarket(bar+1);

CODE:
Please log in to see this code.
profile picture

mikesblack

#7
Many thanks Eugene. I am earnest about enhancing my competence and perhaps this is a good lesson to help inspire that path. :) All the best!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).