Chart and alerts on percentage change in price from two days ago

Discussion in 'Ask A Question' started by Customer Questions, Nov 26, 2012.

This is the TIMETOTRADE forum. Use the TIMETOTRADE Trigger Trading Technology™ to execute your trades when your Price, Candlestick, Trend Line and Technical Analysis chart conditions are met - no coding required. Trade directly in the world’s global markets. Backtest your Trading Strategies. Calculate your UK HMRC Capital Gains Tax liabilities. Manage your Investment Club. Create a FREE account today.

  1. Customer Questions

    Customer Questions John @ timetotrade

    Is it possible to setup a chart with alert to detect when the high stock price value rises by more the x% from Low price 2-days ago?

    The reverse will also apply: i.e. detect price decline(Low) of more that -x% from the High 2-days ago.

    For the above to be useful, the alert must be triggered intra-day as soon as the current day stock high-price (perhaps 15-min bar chart) touches the threshold point.

    The above can also be generalized where the back-lookup days can be other time frames, for instance ...price change in the last 5-Days.
     

    Apply for a trading account today and get the superb Trigger Trading™, Taxation and Investment Club Pro Package for FREE. Get your trading advantage.
  2. Customer Care

    Customer Care John @ timetotrade

    Yes, it is possible to create such an alert. As a first step, you will need to create a custom indicator.

    The indicator will be based on the formula:
    Code:
    High vs Past Low = (((high - past low) / past low) * 100)
     
    where:
     
    - 'high' is the current high price
    - 'past low' is the low price on a previous interval / candle
    - the resulting change from the previous low to current price
      is multiplied by 100 to make it a percentage value

    To build a custom indicator, start with the mathematical formula as above and then substitute each set of brackets with the appropriate indicator function, working from the outside in. In this indicator, the Multiply, Divide, Subtract, High and Past 'Add Indicator' functions will be used.

    To implement the above, start by clicking on the 'Add Indicator' button in the 'Chart Settings'. Search for the 'Multiply (MUL)' function. The Multiply function takes two values e.g. if Value 1 was 3 and Value 2 was 6, the result would be a straight line on the chart at 18 i.e. 3 * 6

    When the Multiply function has been added, set Value 1 to 'Divide (DIV)' and enter 100 in the Value 2 field. Click on the arrow to the right of the 'Divide' field and set the Value 1 Divide field to 'Subtract (SUB)' and the Value 2 Divide field to 'Past Candle (PAST)'.

    The 'Past Candle' function enables the selection of previous candles. It has two fields, mainly the 'Source Data' and the 'Period'. The Source Data for the Past Candle can be set to for example the 'Low Price (LOW)' or the 'High Price (High)', and the Period will be set to '2' as in use the low price from the candle two intervals ago.

    After setting the Value 2 field for the Division function to the Past Low candle from 2 intervals ago, click on the arrow to the right of the 'Subtract (SUB)' function in the Division Value 1 field. We are now going to subtract the current high price from the past low price 2 intervals ago. Set the Subtract Value 1 to 'High Price (High)' and the Value 2 field to 'Past Candle' with the Past Candle Source Data set to 'Low Price (LOW)' and the Period set to 2 i.e. the previous low from 2 intervals ago.

    To give the indicator a more meaningful name, change the 'Legend Reads' field. When finished editing the indicator values, click on the indicator in the 'Chart Settings' and drag it to a new 'Secondary Chart'.

    This completes the process for building the indicator that tracks the current High versus the Low Price 2 intervals ago. To create another version of this indicator whereby the current low is compared to the High Price 2 intervals ago, repeat the steps above changing the references to High and Low prices, using the following formula:

    Code:
    Low vs Past High = (((low - past high) / past high) * 100)


    Using the newly created custom indicators, alerts can be created against them, where the value 1 on the chart axis represents 1% movement.

    When creating alerts against the new indicators, to get real time notification of when the percentage change value has been reached, remember to select the alert option to check the alert on each tick during the interval.

    Rather than building this indicator by hand, you can go to the Chart Settings, click on the Setting Profile in the bottom corner and then import the above custom indicators using the following code: 85A3-B2C2-C9C9
     

    Apply for a trading account today and get the superb Trigger Trading™, Taxation and Investment Club Pro Package for FREE. Get your trading advantage.
  3. Customer Care

    Customer Care John @ timetotrade

    To help further explain how to create the above custom indicators the following screens shots have been prepared:

    1. Import Custom Indicator

    To import the indicator using for example the code 85A3-B2C2-C9C9 or to create a new chart profile for the indicators, click on the 'Settings Profiles' button in the bottom right of the chart settings. Via the 'Settings Profile' either import a chart profile by clicking on the 'Import Profile' button, or create a new chart profile by clicking on the 'Add New Profile' button:

    High vs Past Low 1.png

    2 Create Custom Indicator

    In this example a new chart profile will be created, that will be renamed to 'Past Candle Change':

    High vs Past Low 2.png



    To start building the indicator, click on the 'Add Indicator' button and then search for the 'Multiply (MUL)' function as illustrated:

    High vs Past Low 3.png

    The 'Value 1' field of the Multiply function will be set to use the 'Divide (DIV)' function, and the Value 2 field will be set to 100 i.e. the result of the division will be multiplied by 100 to represent the result as a percentage value, where 1 equals 1%:

    High vs Past Low 4.png

    The Divide function will divide the subtraction of the current high value from the past low value. To implement this set the Divide 'Value 1' field to 'Subtract (SUB)' and the Value 2 field to 'Past Candle (PAST)':

    High vs Past Low 7.png

    In this example the Divide Value 2 field will use the Past Low price from a candle two periods ago:

    High vs Past Low 5.png

    The Divide Value 1 field will use the Subtract function, which will subtract the current 'High Price (HIGH)' from the 'Past Candle (LOW)':

    High vs Past Low 6.png

    The newly created indicator can be given a custom name that will be displayed in the indicators list and on the chart by changing the 'Legend reads' field to for example, 'High vs Past Low':

    High vs Past Low 8.png

    To move the newly created indicator from the price chart to a secondary chart, click on the indicator name in the chart settings and drag the indicator down and drop it in the 'Secondary Chart' area:

    High vs Past Low.png
     
    Last edited by a moderator: Jul 16, 2015

    Apply for a trading account today and get the superb Trigger Trading™, Taxation and Investment Club Pro Package for FREE. Get your trading advantage.
  4. Customer Care

    Customer Care John @ timetotrade

    A related help video, including the development of a Breakout Trading Strategy.



    To learn more about back testing: http://forum.timetotrade.eu/threads/how-does-the-back-testing-work.80/

    Open a FREE timetotrade account today:
     
    Last edited by a moderator: Jul 16, 2015

    Apply for a trading account today and get the superb Trigger Trading™, Taxation and Investment Club Pro Package for FREE. Get your trading advantage.

Share This Page

Open a FREE TIMETOTRADE account today:
Execute your Trigger Trading™ strategies automatically in the world’s global markets. Apply Now to try our superb platform and get your trading advantage.
170+ Technical Analysis and Candlestick Pattern Indicators - learn more
Back Test Trading Strategies - learn more
Manage your Portfolio and calculate UK HMRC Capital Gains liabilities and SA 108 CGT Return - learn more
Manage your Investment Club and generate UK HMRC Investment Club Tax Return Form 185 - learn more