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)
When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the thirty candles before the cross.
If then this maximum will be broken upwards we will have long signal, otherwise short.
I have verified that it does not respect the minimum or maximum constraint of the 30 candles before the cross.
What's wrong with the formula ??
thank you.
luca
code:
Input: average(c), len(60), len1(90),len2(150);
condition1= len>len1 and len>len2 and len1>len2 ;
condition2=len<len1 and len<len2 and len1<len2;
condition3=H crosses over Highest(h,30);
condition4=L crosses under Lowest(l,30);
if condition1 and condition3 then buy next bar at market;
if condition1 and condition4 then sellshort next bar at market;
Can you help answer these questions from other members on NexusFi?
the code snippet you posted can't trigger any entries as condition1 can never become true. Based on that it's hard to tell you what is wrong, but you could use the print reserved word to find out what values your code used exactly that caused the entry.
My problem is to code.
example buy:
When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.
the first thing to add to your code would be the computation of the averages. After that you can check when your conditions are true i.e. on which bar and what values they use for the crossings using the print reserved word.
This will help you understand what it's going on within your code.
the code has improved,but it still does not respect the condiction:
if condition1 then entryl= highest(h,max)[1];
if condition2 then entrys=Lowest(l,min)[1];