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

VWAP error

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

    VWAP error

    Hi Everyone,

    I have downloaded a VWAP indicator but it didn't work(was looking for multi time frame VWAP NT7). I have no idea about coding. When I compiling it says something wrong with SeesionBegin Would you please help to correct the codes?

    Much appreciate

    if (CurrentBar == 0)
    {
    if(Bars.MarketDataSubscribed)
    loadtime = Now;
    else
    loadtime = DateTime.Now;

    sessionend = new DateTime(Bars.SessionBegin.Year, Bars.SessionBegin.Month, Bars.SessionBegin.Day, Bars.SessionEnd.Hour, Bars.SessionEnd.Minute, Bars.SessionEnd.Second);
    startTimeDate = new DateTime(Bars.SessionBegin.Year, Bars.SessionBegin.Month, Bars.SessionBegin.Day, startTime.Hours, startTime.Minutes, startTime.Seconds);
    endTimeDate = new DateTime(Bars.SessionBegin.Year, Bars.SessionBegin.Month, Bars.SessionBegin.Day, endTime.Hours, endTime.Minutes, endTime.Seconds);

    // Checks to ensure End Time is not before Start Time: if it is set End Time to SessionEnd Time
    if (DateTime.Compare(endTimeDate, startTimeDate) < 0)
    endTimeDate = sessionend;

    // Determines whether to use SessionBegin Time or Start Time: If Start Time undefined/less than SessionBegin, use SessionBegin
    if (startTime.TotalMinutes == 0 || ToTime(startTimeDate) < ToTime(Bars.SessionBegin))
    useSessionBegin = true;
    }
    Attached Files
    Last edited by Netrix; 08-26-2019, 10:24 AM.

    #2
    Hello Netrix,

    Did you download the VWAP made for NinjaTrader 7 or for NinjaTrader 8?

    May I have a link to the download page for the importable file you have downloaded?


    Are you importing this using the supported steps?

    To import a NinjaTrader 7 NinjaScript you will need the original .zip file.

    Follow these steps to import the NinjaScript:
    1. Download the script to your desktop, keep it in the compressed .zip file.
    2. From the Control Center window select the menu File > Utilities > Import NinjaScript
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.
    Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

    I ask because it should be possible to have errors with a script that was imported with the proper steps. If there is an error, it should prevent the script from being imported.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea B.

      I have uploaded the ZIP file. Please review.

      Originally posted by NinjaTrader_ChelseaB View Post
      Hello Netrix,

      Did you download the VWAP made for NinjaTrader 7 or for NinjaTrader 8?

      May I have a link to the download page for the importable file you have downloaded?


      Are you importing this using the supported steps?

      To import a NinjaTrader 7 NinjaScript you will need the original .zip file.

      Follow these steps to import the NinjaScript:
      1. Download the script to your desktop, keep it in the compressed .zip file.
      2. From the Control Center window select the menu File > Utilities > Import NinjaScript
      3. Select the downloaded .zip file
      4. NinjaTrader will then confirm if the import has been successful.
      Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

      I ask because it should be possible to have errors with a script that was imported with the proper steps. If there is an error, it should prevent the script from being imported.

      Comment


        #4
        Hello Netrix,

        The file you have provided is created for NinjaTrader 6.5 (6.5.1000.1) and is not compatible with NinjaTrader 7.

        That said, I am very confused on how you were able to get errors as this indicator should not have been able to import into NinjaTrader 7 using the supported import steps..

        Below I am providing a link to the User App Share for a VWAP indicator created for NinjaTrader 7.
        https://ninjatraderecosystem.com/use...average-price/

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Last edited by NinjaTrader_ChelseaB; 08-26-2019, 10:59 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Hi Chelsea B.
          I need one that can specify the time frame. Could you please to convert it? thanks.

          Comment


            #6
            Hello Netrix,

            Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

            That said, I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

            This thread will also remain open for any community members that would like to convert this as a convenience to you.

            You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


            Below is a link to the code breaking changes for NinjaTrader 7.


            With Bars.Session.GetNextBeginEnd() this can provide the session start and end times.


            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Stanfillirenfro, Today, 07:23 AM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            2 responses
            20 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by olisav57, Yesterday, 07:39 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cocoescala, 10-12-2018, 11:02 PM
            7 responses
            943 views
            0 likes
            Last Post Jquiroz1975  
            Started by oviejo, Today, 12:28 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X