Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BackColor & alerts based on orders entered

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

    BackColor & alerts based on orders entered

    Hi - a short time ago, you kindly showed me how to code strategies using rising/falling conditions and EnterShortStopLimit to enter trades. This is working very well. Thank you.

    What I would like to be able to do now is have a chart which places one color on the chart (using 'BackColor') for when long trades are in progress and another color for short trades.

    Is this possible and I'd be very grateful for your explanation as to how to proceed.

    Moreover, would it be possible to have alerts sound, i.e. sound files I could make or choose (besides the usual "order entered", etc.) whenever trades are entered?

    Roughly, the coding looks like this:

    if (Rising(...) == true)
    {
    EnterLongStopLimit(0, true, 1, Close[0] + 10 * TickSize, Close[0] + 10 * TickSize, "BuyStop");

    if (Falling(...) == true)
    {
    EnterShortStopLimit(0, true, 1, Close[0] - 10 * TickSize, Close[0] - 10 * TickSize, "SellStop");

    Many thanks in advance.

    Arbuthnot

    #2
    Hello Arbuthnot,

    Thank you for your note.

    You could create a separate if statement to check when you are long and color the background accordingly.

    if (Position.MarketPosition == MarketPosition.Long)
    {
    BackColor = Color.PaleGreen;
    }

    This example will check your MarketPosition and then the following action will be to change the background color.

    MarketPosition


    BackColor()
    CameronNinjaTrader Customer Service

    Comment


      #3
      That's great, Cameron. I've done as you suggested and the trades show up perfectly.

      Much obliged.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      7 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      4 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      12 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      13 views
      0 likes
      Last Post bltdavid  
      Working...
      X