NexusFi: Find Your Edge


Home Menu

 





Funtion: Filter combo?!


Discussion in MultiCharts

Updated
    1. trending_up 416 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread

Funtion: Filter combo?!

  #1 (permalink)
maxk
Taipei, Taiwan
 
Posts: 9 since Jun 2023
Thanks Given: 2
Thanks Received: 1

Hello everyone,

I'm coding a funtion for filters combo as attached PLA, could anyone help me to correct it?

Thank you in advance for any kind of help.

Grand

Attached Files
Elite Membership required to download: FxCombo.pla
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

Hi maxk, please post the code here if you can. More likely to get someone to look over it if they don't have to download and import.

A compile error if you are getting one would be helpful in pinpointing as well.

Sent using the NexusFi mobile app

Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
maxk
Taipei, Taiwan
 
Posts: 9 since Jun 2023
Thanks Given: 2
Thanks Received: 1


Hi ShadowFox, thank you for your response, please see the codes below:

Inputs:
Fx1(Numeric), Fx3(Numeric), Fx5(Numeric);

Vars:
Fx1_V(True), Fx3_V(True),
Fx5_V(True), FxL(0);

If Fx1 = 1 then Fx1_V =
O > H[1];
If Fx3 = 1 then Fx3_V =
O > C[1];
If Fx5 = 1 then Fx5_V =
_Volume < _Volume[1];

FxL = Fx1_V and Fx3_V and Fx5_V;

//

and the comply error is:
Types are not compatible
line 15, column 0



ShadowFox View Post
Hi maxk, please post the code here if you can. More likely to get someone to look over it if they don't have to download and import.

A compile error if you are getting one would be helpful in pinpointing as well.

Sent using the NexusFi mobile app


Reply With Quote
  #4 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

Hi Maxk,

Your If statements are fine but they are not doing what you want them to do. I see what you are doing with the filter input switches. I would suggest cleaning up the If statement.

If Fx1 = 1 and O > H[1] then Fx1_V = true
else Fx1_V = false;

Warning, this provides a false even if O > H[1] when Fx1 = 0. Your final line to check whether all the values are true then do something. If one of the switches is off, it will make the value false and therefore never fill the final conditions.

The final error and what is causing the compile error is the FxL final output. You are establishing this as numeric but attempting to apply a bool to it.

I would suggest something like this to clean it up.

 
Code
Inputs:
Fx1(Numeric), Fx3(Numeric), Fx5(Numeric);

Vars:
Fx1_V(False), Fx3_V(False),
Fx5_V(False), FxL(False);

If (Fx1 = 1 and O > H[1]) or Fx1 = 0 then Fx1_V = true
else Fx1_V = false;
If (Fx3 = 1 and O > C[1]) or Fx1 = 0 then Fx3_V = true
else Fx3_V = false;
If (Fx5 = 1 and Volume < Volume[1]) or Fx5 = 0 then Fx5_V = true
else Fx5_V = false;

FxL = Fx1_V and Fx3_V and Fx5_V;

Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
maxk
Taipei, Taiwan
 
Posts: 9 since Jun 2023
Thanks Given: 2
Thanks Received: 1

Hi ShadoFox,

Thanks for your help, but still comply error:

"Types are not compatible"



ShadowFox View Post
Hi Maxk,

Your If statements are fine but they are not doing what you want them to do. I see what you are doing with the filter input switches. I would suggest cleaning up the If statement.

If Fx1 = 1 and O > H[1] then Fx1_V = true
else Fx1_V = false;

Warning, this provides a false even if O > H[1] when Fx1 = 0. Your final line to check whether all the values are true then do something. If one of the switches is off, it will make the value false and therefore never fill the final conditions.

The final error and what is causing the compile error is the FxL final output. You are establishing this as numeric but attempting to apply a bool to it.

I would suggest something like this to clean it up.

 
Code
Inputs:
Fx1(Numeric), Fx3(Numeric), Fx5(Numeric);

Vars:
Fx1_V(False), Fx3_V(False),
Fx5_V(False), FxL(False);

If (Fx1 = 1 and O > H[1]) or Fx1 = 0 then Fx1_V = true
else Fx1_V = false;
If (Fx3 = 1 and O > C[1]) or Fx1 = 0 then Fx3_V = true
else Fx3_V = false;
If (Fx5 = 1 and Volume < Volume[1]) or Fx5 = 0 then Fx5_V = true
else Fx5_V = false;

FxL = Fx1_V and Fx3_V and Fx5_V;


Reply With Quote
  #6 (permalink)
alan tsai
Taipei ,Taiwan
 
Posts: 3 since Apr 2021
Thanks Given: 44
Thanks Received: 0

FxL = Fx1_V change Fx1 = Fx1_V

Reply With Quote




Last Updated on March 10, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts