Jump to content
Medved Trader Forums
  • 0
nasdorq

Paintbar related ideas

Question

Just thought I'd throw a couple ideas out there that relate to paintbars.

1)  Audio alerts for paintbars

2)  Being able to create the same type of alerts we can with paintbars, but instead of only having them for charts, also be able to apply them to a list of symbols.  I've seen it elsewhere, where it looks like a grid/spreadsheet.  Symbols on the left, Names of Alerts along the top columns.  When an alert triggers for a certain symbol, the cell flashes.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

One idea might be a trigger "once per bar" setting.  Currently if a trader wants this, they could set the clearing time to the same # of seconds as the current timeframe.  However, it becomes difficult if a trader frequently changes the timeframes on their charts at different times of the day, or if they simply have a lot of charts with varying timeframes.

 

Once per bar means everything is constant, regardless of the chart timeframe.

Edited by nasdorq

Share this post


Link to post
Share on other sites
  • 0

You can implement that now relatively easily.  in Advanced mode, you can have variables. Just specify a variable outside of the main method

DateTime LastTriggeredTimestamp = DateTime.MinValue; 

In the code, when you are ready to trigger alert, do

if (LastTriggeredTimestamp != Timestamp)
{
.... trigger the alert
     LastTriggeredTimestamp = Timestamp;

}

Share this post


Link to post
Share on other sites
  • 0

True range:  Max of the three values:

Candle High - Candle Low

Absolute value of Candle High - Previous Candle Close

Absolute value of Candle Low - Previous Candle Close

Average it either by using SMA or EMA.

Share this post


Link to post
Share on other sites
  • 0

Thanks for the example above Jerry, for only getting an alert once per bar.  If I could post a quick follow up.  I tried to implement it but I didn't do it properly.

For simplicity, it's an alert when the high > prior bars high.  I'm using the method where if the result is false, to end the code using "return", and therefore keep going if it's true.

public void MainCalculation()

{

     {

           if (High <= High[1])

           return;

     }

     {

            if (LastTriggeredTimestamp != Timestamp)

                 {

                  SetColor(SysColor.MainIndicator1);

                  TriggerAlert("dalert", @"dmessage");

                  LastTriggeredTimestamp = Timestamp;

                  }

       }

}

The error I get is : The name 'LastTriggeredTimestamp' does not exist in the current context.  I get it for Pos 8,13 and 12,13.  Do you know what I'm doing wrong?

 

edit:  I can't seem to post normally so I had to remove formatting

Edited by nasdorq

Share this post


Link to post
Share on other sites
  • 0

C# is one of the languages that requires a variable's explicit declaration (unlike something like Lua)

So, before the line

public void MainCalculation()

 

you need to add this line:

DateTime LastTriggeredTimestamp = new DateTime(0);

that would declare the variable and eliminate the error.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...