Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multitimeframe not working

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

    Multitimeframe not working

    Hi, im currently running this code
    but it doesnt behave as i want it to.

    protected override void Initialize()
    {
    Add(PeriodType.Day, 1);
    CalculateOnBarClose = true;
    }


    protected override void OnBarUpdate()
    {
    if (CurrentBars[0] < 1 || CurrentBars[1] < 1)
    {
    Print ("return");
    return;
    }
    Print ("works");
    }
    I have a RangeBar loaded and about 20 days of data but i never seem to get pass "return".
    But as far as i am concerned, after the first day has passed it should output "works" instead of "return" but that doesnt work.

    anyone an idea why.

    #2
    The script should run as expected.

    If it does not run, you have probably forgotten to load daily data.

    Please connect to a datafeed, load daily data to your historical data base.

    Then run the script again and it should reach the state "works".

    Comment


      #3
      oh i didnt know i had to do that. that makes sense. thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      51 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      32 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      99 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      177 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      170 views
      0 likes
      Last Post CarlTrading  
      Working...
      X