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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    45 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X