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

set plots to drawtext

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

  • imalil
    replied
    It's working now. The 'pricealert' code has this in the alert statement: Cbi.Core.InstallDir. The help guide does not mention it. So I dropped it in and it now works. It's, however, hard coded; I'd like a variable, which I'm working on.

    Thanks.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    The PriceAlert indicator provides has uses the Alert() method with sound. You can view it by going to Tools> Edit NinjaScript> Indicator> PriceAlert > OK.
    The help guide also provides an example for the Alert() method which has a sound: http://ninjatrader.com/support/helpGuides/nt7/alert.htm

    Is the sound file that you chose a .wav file?
    Can you provide your line of code you are using for the Alert() method including the string for your file path for the sound file?

    Leave a comment:


  • imalil
    replied
    My alert is not recognizing my absolute file path which holds my sound files.

    Is there a Ninja indicator which has audio alert code I can look at?

    If not, could you give me an example of an IF statement followed by an alert() statement, complete with sound file path? I assume it goes in OnBarUpdate.

    Thank you.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    You can add a sound alert by using the Alert() method. Please see the following link on the Alert() method: http://ninjatrader.com/support/helpGuides/nt7/alert.htm
    You can also use the PlaySound() method to trigger just a sound. Please see the follwoign link on the PlaySound() method:http://ninjatrader.com/support/helpG.../playsound.htm
    If we can be of any other assistance please let us know.

    Leave a comment:


  • imalil
    replied
    I asked a friend about this and he solved my problem:

    Add(new Plot(Color.Transparent, "Your Plot Name"));
    This gives me my plot and leaves my DrawText alone to print.

    Do you know how I can go about including sound alert code into my indicator?

    Thank you.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    In your previous post you mention that you try to set the plot to the variable placementimballevel but you receive errors.
    As the placementimballevel is where you are placing your drawtexts this is what you would want the plots to be based off of.
    What errors do you receive when you set the plot to the placementimballevel?

    Leave a comment:


  • imalil
    replied
    Originally posted by NinjaTrader_CodyB View Post
    Hello,
    What error message do you receive when you try to set the plot to placementimballevel?
    I'm sorry, I don't think I was clear. I'm not setting a plot to placementimballevel--which is simply the number of ticks away from the high or low of a bar. placementimballevel is not the result I want printed--it's where I WANT the result printed. The errors occurred when I tried to set a plot to the DrawText command itself. I realize this is incorrect, but I do not know how to set it to a variable that will then print my DrawText command. So I'm basically grasping at straws.

    I have to assume others use the DrawText command with plots. If so, how do they do it?

    Thank you.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    What error message do you receive when you try to set the plot to placementimballevel?

    Leave a comment:


  • imalil
    replied
    Here is one of my draw text commands:

    { DrawText("imbalance" + CurrentBar, AutoScale, (+ imbalance).ToString(), 0, Low[0], -(placementimballevel), Color.Pink, ChartControl.Font, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);}
    This prints my indicator result perfectly. I made a variable, 'placementimballevel' which lets me put the result as far below the bar as I choose. Whenever I set a plot to this command (which I'm sure is wrong), I get errors. But the only printing of my result I want on my chart is via this drawtext. I simply want to add some plots, then set these plots to something that will allow it to print exactly as it does right now.

    Thanks. Any help would be greatly appreciated.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    If you have your plot set to the value of it is expected that it will plot at that value. If you are wanting it to display the message elsewhere you would need to add in custom logic to place for the plot to appear where you are wanting it to.
    Can you clarify or provide a screenshot of where you are wanting the plots to actually plot at?

    Leave a comment:


  • imalil
    replied
    Thanks for all your help. I've been trying to do something for the longest time with no luck. My ind prints via DrawText. It prints my results around the bars on my charts. I realize to use strategies I need to set my results to plots. So I make my plots and set them = to my variables. But, if my ind creates a value of, say, 1, and the instrument is at a value of 1000, it always prints the 1 at the actual value of 1, which is 1000 points away from where I want it. This makes it unusable. My ind works fine without using plots.

    I'd appreciate any help. Thanks.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    Yes, the bid volume is the number of orders placed at the bid price including the orders that do not get filled.

    If we can be of any other assistance please let us know.

    Leave a comment:


  • imalil
    replied
    Thanks, I'll try this. So are you saying "bid volume" the total of all orders placed at the bid whether or not they're filled?

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    What you refer to in your last post is the traded volume. This is not equal to the bid volume + ask volume.

    To get this volume you can simply use the Volume method on the primary dataseries which is Volume[0].

    Please see the following link on the Volume method: http://ninjatrader.com/support/helpG...t7/volume2.htm

    You could create a plot that holds these values by doing the following:
    Code:
    Add(new Plot(Color.FromKnownColor(KnownColor.RoyalBlue), PlotStyle.Bar,   "myVolume"));
    
    protected override void OnBarUpdate()
    {
        myVolume.Set(Volume[0]);
    }
    Please let us know if you have any further questions.

    Leave a comment:


  • imalil
    replied
    Originally posted by NinjaTrader_CodyB View Post
    Hello,
    The code provided should process exactly as you are wanting.
    Can you clarify that you are indeed wanting the Bid volume and the Ask Volume and not the traded Volume of the Bar?
    Also so I may test further please clarify what instrument you are testing this on.
    I use ES 3-16. I think I'm unclear as to what traded vol of the bar is. When I look at order flow, there is a total volume. When I click the center wheel of my mouse over the regular bars on my chart, there is a volume. These two volumes are the same. That is the volume I need. Is this traded Volume of the Bar? If so, that is what I'm after.

    Thanks for the help.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by halgo_boulder, Today, 08:44 AM
0 responses
1 view
0 likes
Last Post halgo_boulder  
Started by drewski1980, Today, 08:24 AM
0 responses
3 views
0 likes
Last Post drewski1980  
Started by rdtdale, Yesterday, 01:02 PM
2 responses
17 views
0 likes
Last Post rdtdale
by rdtdale
 
Started by TradeSaber, Today, 07:18 AM
0 responses
7 views
0 likes
Last Post TradeSaber  
Started by PaulMohn, Today, 05:00 AM
0 responses
10 views
0 likes
Last Post PaulMohn  
Working...
X