Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

CrossAbove with Multitimeframes

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

    CrossAbove with Multitimeframes

    Hello,

    Probably a newbie question but I would like to know how to use the CrossAbove function using multitimeframes.

    So basically I have added three extra timeframes using the Add(PeriodType.Minute, xxx); function.

    Now when I enter the following code:

    Code:
    		if (CrossAbove(CCI(Closes[1],20)[0],-100,1)) {
    				Print("True");	
    			}
    Basically I want to see if the CCI for the 1st added timeframe crosses above -100 within the last bar is true.

    If gives me the following error:

    Strategy\CCICross.cs The best overloaded method match for 'NinjaTrader.Strategy.StrategyBase.CrossAbove(doub le, NinjaTrader.Data.IDataSeries, int)' has some invalid arguments CS1502 - click for info 60 8

    Strategy\CCICross.cs Argument '2': cannot convert from 'int' to 'NinjaTrader.Data.IDataSeries' NT1503 - click for info 60 40


    Help!

    #2
    Hello siroki,

    Thank you for your post.

    You would need to use BarsArray[1] in place of Closes[1] for the CCI() method. For information on BarsArray please visit the following link: http://www.ninjatrader.com/support/h.../barsarray.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    64 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by benmarkal, Today, 12:52 PM
    2 responses
    13 views
    0 likes
    Last Post benmarkal  
    Started by f.saeidi, Today, 01:38 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X