Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export as Compiled Assembly issues

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

    Export as Compiled Assembly issues

    Hello,

    I have an indicator that uses Draw.Text to print a value next to the close of the price bar. The indicator works just fine but I run into trouble when I use the Export as Compiled Assembly.

    First, the compiled assembly could not be imported. I got the message "Error compiling import assembly: c:\Users\Will\Documents\NinjaTrader 8\bin\Custom\ChangeFontB.cs(35,34) : error CS0246: The type or namespace name 'SimpleFont' could not be found (are you missing a using directive or an assembly reference?)".

    I figured out how to work around this issue by changing all references to SimpleFont in the source code to the fully qualified NinjaTrader.Gui.Tools.SimpleFont. This included changing it the region "NinjaScript generated code. Neither change nor remove".

    Second, once I imported the compiled assembly everything worked fine until I opened the Properties window for a drawing object. When I did that the Draw.Text froze. To unfreeze it I opened and closed the Indicators window on the chart. This only happens with the compiled version, not the source version. I haven't figured out how to fix this.

    To replicate the two problems:
    • Import SampleChangeFont from this post: http://ninjatrader.com/support/forum...ad.php?t=19170
    • Use Export as Compiled Assembly to create a compiled version. Remove the original source version of the indicator.
    • Attempt to import the compiled assembly. The import will fail.
    • Go back to the original SampleChangeFont and make sure SimpleFont is fully qualified as NinjaTrader.Gui.Tools.SimpleFont everywhere in the code, including the NinjaScript generated code region.
    • Use Export as Compiled Assembly again. Remove the original source version.
    • Import the compiled assembly. This time it will work.


    Now for the second problem:
    • Add the compiled SampleChangeFont to the chart (not the source version).
    • Add a horizontal line.
    • Open the Properties window for the horizontal line. Note how the indicator freezes and no longer updates. This is most easily seen if you set it to update on each tick.
    • Now open the Indicators window and close it. The indicator resumes normal functioning.

    As I said, this freezing problem only happens with the compiled assembly, not the source code version of the indicator.

    I suspect both problems have something to do with the compiler but don't know for sure. If there's a solution to the freezing Draw.Text please let me know.

    Thanks and regards,
    Will.
    Last edited by willpf; 03-16-2016, 03:43 PM.

    #2
    Thank you for putting together this report. I can definitely see the first issue, and we are looking into a potential solution for this now. However, I do not see the second issue on my end. Even with OnEachTick, I see the text continue to update in realtime with the Drawing Tools menu open. I will post back with an update on what we find to resolve the first issue, and continue to try to reproduce the second.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Hello Dave,

      On the second issue, use the compiled version of the indicator, not the source version. Place a horizontal line and select Properties for the horizontal line, then close the Properties window. Not the Drawing Tools menu.

      Regards,
      Will.

      Comment


        #4
        I meant to say Drawing Objects window. Unfortunately, these are the exact steps I tested with. Could there be anything else coming into play in your scenario that we might be overlooking? Any other scripts running on the chart, etc.?
        Dave I.NinjaTrader Product Management

        Comment


          #5
          This was isolated and will ber resolved in B11 - NTEIGHT-9577
          MatthewNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GLFX005, Today, 03:23 AM
          0 responses
          1 view
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          11 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          14 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          3 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X