Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Load Filter/Trigger from external source for testing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Load Filter/Trigger from external source for testing

    Is there anyway to have an external file that contains filters/triggers and select which filters/triggers to use from that file based on input from the strategy file.

    External file idea:

    var Filter1 = Close[0] > SMA1[0] && SMA1[0] > SMA1[1];
    var Filter2 = Close[0] > Open[0] && Close[1] < Open[1];
    var Filter3 = Open[1] < Bollinger1.Upper[1] && Close[0] > Bollinger1.Upper[0];
    etc.....

    Strategy

    if ( Close[0] > Close[1]
    && "Filter/Triggers = 1" // load Filter1

    {
    EnterLong()
    }


    #2
    Hello rodriguesdanny,

    A strategy is a running C# file so technically it can read a file and parse it every so often. You can run into file io errors by doing that if something else is reading/writing the file. Can you provide more specific details on what you are trying to do?

    Comment


      #3
      I am in the process of testing and developing several strategies and I have over 1000 filters/triggers that I would like to test against different entry conditions. Instead of having to have all of those filters in every strategy I would like to have 1 file that contains all of the filters that I can reference from the main strategy. Then use the optimization feature in the Strategy Analyzer go through the different filters.

      Comment


        #4
        Hello rodriguesdanny,

        You can read data from fies. If you can make logic to parse various options read from the file you could do something like you are asking.



        An optimization is multithreaded so you may also need to set IsInstantiatedOnEachOptimizationIteration and read the file one time for the purpose of loading data once per optimization.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X