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

Using Time Filters

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

    Using Time Filters

    Please I need your help to put my strategy long short Butoom

    The filter activate trading by days of the week and by hours of the day

    Example I want my strategy only to be activated on Monday and Tuesday

    Only trade between 7:45 AM and 1:45 PM Click image for larger version

Name:	Captura de Pantalla 2020-12-16 a la(s) 21.10.05.png
Views:	156
Size:	52.0 KB
ID:	1132705

    #2
    Welcome to the forums BRAMHAN!

    I have moved this post to a new thread as it is a separate topic than the thread where you originally posted.

    Please use the "+ New Topic" button to open a new thread.

    You also emailed us about this this morning. I have included our response below.

    Hello,

    Thank you for writing in.

    It seems that you are is missing curly braces in the OnBarUpdate section of your script. Curly braces would need to be added to your if statements regarding the time parameters. Please see the publicly available links below for more information about using curly braces in C# and if statements.

    Curly Braces in C# — https://jeremybytes.blogspot.com/201...parate%20line.

    If-else Statements — https://docs.microsoft.com/en-us/dot...ywords/if-else


    To get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:

    https://ninjatrader.com/support/help...g_concepts.htm

    Also, here is a link to our publicly available training video, 'NinjaScript Editor 401', for you to view at your own convenience.

    NinjaScript Editor 401 - https://youtu.be/H7aDpWoWUQs?list=PL...We0Nf&index=14

    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:

    https://ninjatrader.com/support/help..._resources.htm

    And the MSDN (Microsft Developers Network) C# Language Reference.

    https://ninjatrader.com/support/help...erence_wip.htm

    I have personally found DotNetPerls to be a very helpful publicly available educational resource with simple, direct, and easy to follow examples.
    Browse examples for many languages, with explanations and code side by side for easy understanding.


    Other useful resources on learning C# that are publicly available:
    NinjaScript Debugging
    Softsteel Soluions
    CSharp Essentials
    C# Station
    The Code Project
    Please let us know if we may assist further.
    Please let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sofortune, Today, 10:05 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by ETFVoyageur, 05-07-2024, 07:05 PM
    23 responses
    185 views
    0 likes
    Last Post ETFVoyageur  
    Started by reynoldsn, 05-10-2024, 07:04 PM
    7 responses
    39 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by ETFVoyageur, Today, 02:15 AM
    5 responses
    31 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by drnoggin, Today, 12:19 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X