NexusFi: Find Your Edge


Home Menu

 





Multiple Values in an Input?


Discussion in EasyLanguage Programming

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




 
Search this Thread

Multiple Values in an Input?

  #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?
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
56 thanks
Funded Trader platforms
44 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

CreativelyChris,

welcome to futures.io. 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 Twitter 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,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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 Twitter Reply With Quote




Last Updated on September 9, 2021


© 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