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 there,
I’m trying to code a filter combo which will collect useful filter or filters for certain signals from the list. Does anyone know how to finish this?
Code example: (Fx from 0 to 1)
Inputs: Fx1(0), Fx2(0), Fx3(0), Fx4(0); {there could be more Fx}
If Fx1 = 1 then begin
Value1 > Value1[1]; {Trend}
end;
If Fx2 = 1 then begin
Value1 < Value1[1]; {C.Trend}
end;
If Fx3 = 1 then begin
Value3 < AbsValue(Value1 – Value2); {Bios}
end;
If Fx4 = 1 then begin
Value4 < AbsValue(C-Value1); {Bios}
end;
If MP <= 0 and Fx1 and Fx2 and Fx3 and Fx4 then buy next bar at Value11 stop;
If MP >= 0 and Fx1 and Fx2 and Fx3 and Fx4 then buy next bar at Value22 stop;
Thanks for your time.
Can you help answer these questions from other members on NexusFi?
Condition1 = C cross over Value66;
Condition2 = C cross under Value66;
If Fx1 = 1 then begin
Fx1_Result = Value55 > Value55[1];
end;
If Fx2 = 1 then begin
Fx2_Result = Value55 < Value55[1];
end;
If Fx3 = 1 then begin
Fx3_Result = Value77 < BiosL;
end;
If Fx4 = 1 then begin
Fx4_Result = Value77 < BiosL;
end;
If Fx5 = 1 then begin
Fx5_Result = Value77 < Value77[1];
end;
If Fx6 = 1 then begin
Fx6_Result = Value77 > Value77[1];
end;
If MP <= 0 and Condition1 and Fx1 and Fx2 and Fx3 and Fx4 and Fx5 and Fx6 then buy next bar market;
If MP >= 0 and Condition2 and Fx1 and Fx2 and Fx3 and Fx4 and Fx5 and Fx6 then buy next bar market;
I suspect it's your buy conditions. You used your filter selection inputs which were numbers instead of your RESULT variables which are bools. The invalid type is referring to the condition needing to be a bool.
Forgot to mention that you should set your results to be true if your input condition is zero (assuming you are flipping a zero and one). This will allow your buy conditions to still be met when the filter is off.
Thanks for your respone but I don't really understand, could you please give an example?
ShadowFox
Forgot to mention that you should set your results to be true if your input condition is zero (assuming you are flipping a zero and one). This will allow your buy conditions to still be met when the filter is off.
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,388
Thanks Received: 10,208
maxk
Thanks for your respone but I don't really understand, could you please give an example?
ShadowFox
I suspect it's your buy conditions. You used your filter selection inputs which were numbers instead of your RESULT variables which are bools. The invalid type is referring to the condition needing to be a bool.
Believe he's saying
If MP <= 0 and Condition1 and Fx1 and Fx2 and Fx3 ... and Fx6 then buy next bar market;
Should be
If MP <= 0 and Condition1 and Fx1_Result and Fx2_Result and Fx3_Result ... and Fx6_Result then buy next bar market;
ShadowFox
Forgot to mention that you should set your results to be true if your input condition is zero (assuming you are flipping a zero and one). This will allow your buy conditions to still be met when the filter is off.
And here if you want it to be true when input is zero then
Thank you both very much, it work and I finish what I want.
Thank you.
ShadowFox
Forgot to mention that you should set your results to be true if your input condition is zero (assuming you are flipping a zero and one). This will allow your buy conditions to still be met when the filter is off.
SMCJB
Believe he's saying
If MP <= 0 and Condition1 and Fx1 and Fx2 and Fx3 ... and Fx6 then buy next bar market;
Should be
If MP <= 0 and Condition1 and Fx1_Result and Fx2_Result and Fx3_Result ... and Fx6_Result then buy next bar market;
And here if you want it to be true when input is zero then