Futuromaniak,
Where are you having troubles with your coding of this system? How much have you managed on your own so far? If you post what you have done so far, then I am sure someone will assist and show you how to correct the code to ensure you get the results you want.
When confronted with a coding a problem, one way to solve the problem is to break the problem down into its smallest components, code each small part then gradually add the code together.
Using your first criteria as an example:
Futuromaniak wrote:Enter Long if today’s maximum will be higher than today’s open + 60%ATR from last 4 days ( not including today)
I think the first part to code will be, "ATR from last 4 days ( not including today)"
Now, take the second part, "today’s open + 60%ATR from last 4 days ( not including today)", but we already have part of this coded, so we actually only need, "today’s open + 60% myATR"
Code:myPrice:=open + 0.6*myATR;
The last part, "today’s maximum will be higher than myPrice"
When you put it all together:
Code:myATR:=ref(atr(4),-1);
myPrice:=open + 0.6*myATR;
long:=H > myPrice;
Test this and see if it produces the results you want. If it does, great. If it doesn't, then go back through the parts of the code and try to figure out where the problem is occurring or needs refining. Once you have ironed out all the bugs, you might then like to consolidate the code (if you need to, otherwise just leave it):
Code:long:=H>(open+0.6*(ref(atr(4),-1)));
Using steps like these, you should be able to solve most problems. Try working through the short entry problem in a similar fashion. Let us know how you go.
Hope this helps.
wabbit [:D]
P.S. Also, when writing your codes, try not to think in terms of the future because then you might accidentally write some code that uses forward referencing; this uses produces great theoretical results but cannot actually be traded. Where you say, "Enter Long if today’s maximum WILL BE higher than today’s open," it might be better to say something along the lines of, "enter a long trade if the high IS greater than the open" It's a small difference that might stop you making a big mistake one day. [:)]
P.P.S. All codes untested as I am not on my MS machine tonight!