Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using a variable in the Add() funciton

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

    Using a variable in the Add() funciton

    Hi everyone...

    Is is possible to use a variable in the "Add" function? I'd like the instrument in the Add function to use the instrument selected when the strategy is activated. Is that possible?

    // Add a 1-min interval for the current strategy
    Add("ZB 06-09", PeriodType.Minute, 1);

    So... in the above the "ZB 06-09" would have been pulled from the "instrument" field when applying the strategy.

    Thanks,

    Brian

    #2
    Originally posted by heyligerb View Post
    Hi everyone...

    Is is possible to use a variable in the "Add" function? I'd like the instrument in the Add function to use the instrument selected when the strategy is activated. Is that possible?

    // Add a 1-min interval for the current strategy
    Add("ZB 06-09", PeriodType.Minute, 1);

    So... in the above the "ZB 06-09" would have been pulled from the "instrument" field when applying the strategy.

    Thanks,

    Brian
    You just omit that parameter and it will add different time period for instrument currently on the chart
    Add(PeriodType.Minute, 1);

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    368 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    571 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X