NexusFi: Find Your Edge


Home Menu

 





Multiple Values in an Input?


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
CreativelyChris
Los Angeles, CA
 
Posts: 13 since Sep 2021
Thanks Given: 1
Thanks Received: 0

I have a strategy I want to use where I buy only on certain days of the year - is there a way to put multiple "values" into the an Input of a strategy?

I haven't figured out how to enter in multiple values? (Is that even possible?) Or do I have to modify the code of the strategy in some way?

For example what I want to do is:

 
Code
Input: 25, 35, 45, 55, 65

Thank you for any help!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

CreativelyChris,

welcome to NexusFi. Your best bet will likely be using a string that you use to extract the inputs from within your code. You could provide the dates as one comma separated string for example, but you would have to split this string within your code and extract the dates. Another approach could be reading the inputs in from a file and processing them within your code.

Regards,

ABCTG


CreativelyChris View Post
I have a strategy I want to use where I buy only on certain days of the year - is there a way to put multiple "values" into the an Input of a strategy?

I haven't figured out how to enter in multiple values? (Is that even possible?) Or do I have to modify the code of the strategy in some way?

For example what I want to do is:

 
Code
Input: 25, 35, 45, 55, 65

Thank you for any help!


Follow me on X Reply With Quote
  #3 (permalink)
CreativelyChris
Los Angeles, CA
 
Posts: 13 since Sep 2021
Thanks Given: 1
Thanks Received: 0


Thanks for the help.

I've found in the documentation that in "elsystem.collections" there is a Split() function.

This seems to require me to put the data into a vector.
Is this the best method to go about this?

I'd have to put the string into a vector -> split it -> convert string to a number -> compare my source value (date) to see if it matches any of the values in that vector?


I'm very new to EL, so if there is a better method, or easy way to compare the source value to a list of values any advice/help would be greatly appreciated.


Thank you!


Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

CreativelyChris,

there are multiple reserved words to manipulate strings that would not require using a vector, but the Split method can be very convenient, though.
Split returns "a vector of elements that were delimited by the Separator string". You do not have to put your string in a vector first.

In the end you would need to check if the current bar's date is included in the vector to see if trading is allowed on that day. For that you could convert the
date to a string and check if this string is included in the vector.

Regards,

ABCTG


CreativelyChris View Post
Thanks for the help.

I've found in the documentation that in "elsystem.collections" there is a Split() function.

This seems to require me to put the data into a vector.
Is this the best method to go about this?

I'd have to put the string into a vector -> split it -> convert string to a number -> compare my source value (date) to see if it matches any of the values in that vector?


I'm very new to EL, so if there is a better method, or easy way to compare the source value to a list of values any advice/help would be greatly appreciated.


Thank you!


Follow me on X Reply With Quote




Last Updated on September 9, 2021


© 2026 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 - Downloads - Top
no new posts