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 kevinenergy, Yesterday, 12:01 PM
      6 responses
      22 views
      0 likes
      Last Post kevinenergy  
      Started by DawnTreader, 05-08-2024, 05:58 PM
      15 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by ZeroKuhl, Yesterday, 04:31 PM
      7 responses
      40 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by xepher101, Today, 12:19 PM
      1 response
      22 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by jpeep, 08-16-2020, 08:31 AM
      16 responses
      498 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X