TRO Paintbar for Quotetracker

Discussion in 'Forex Trading' started by automated, Jan 18, 2011.

  1. I pasted the following code from one of TRO's old messages from another forum from 2006.

    To TRO or anyone else,

    What i understand this code is trying to do is to give buy (or sell) alert when the current bar close is equal to or above the midpoint of today's and yesterday's range. I don't know if the intent is to alert when current bar price is above midpoint of today's range and also above the middle of the last bar?

    Anyway, the structure seems to be incorrect. If you have both the above and below (> & <) conditions in the same paintbar it will give a continuous signal (which it did as a continuous red bar below) because the price is always either above or below.

    Can anyone comment / fix the problem please. Thanks.


    <PAINTBAR>
    <ID>NCMPWS</ID>
    <NAME>TROControlMinor</NAME>
    <RULE><EXPR>if Bar Close=( Day High + Day Low) * 0.5 set color to Yellow</EXPR></RULE>
    <RULE><EXPR>if Bar Close&gt;( Day High + Day Low) * 0.5 set color to Blue</EXPR></RULE>
    <RULE><EXPR>if Bar Close&lt;( Day High + Day Low) * .0.5 set color to Red</EXPR></RULE>
    </PAINTBAR>
    <PAINTBAR>
    <ID>JKBMIA</ID>
    <NAME>TROControlMajor</NAME>
    <RULE><EXPR>if Bar Close=( Day High[1] + Day Low[1]) * 0.5 set color to Yellow</EXPR></RULE>
    <RULE><EXPR>if Bar Close&gt;( Day High[1] + Day Low[1]) * 0.5 set color to Blue</EXPR></RULE>
    <RULE><EXPR>if Bar Close&lt;( Day High[1] + Day Low[1]) * 0.5 set color to Red</EXPR></RULE>
    </PAINTBAR>
     
  2. hayman

    hayman

    I have recently looked at this. The intent IS to alert when BOTH the current bar price is above midpoint of today's range AND also above the middle of the previous bar. Your assumption is correct.

    This is not one paintbar, however; these are 2 separate paintbars, which should be run concurrently. If you examine the code you pasted here, you will see that there is an ending paintbar delimeter after the TROControlMinor code and similarly one after the TROControlMajor paintbar. 2 distinct paintbars, that run concurrently.

    Hope that helps.