Prices ending by a round number, such as 20, 50, or 100, have some particularities. The market often considers these prices as support or resistance. That means the probability of seeing a technical rebound after the market touches these prices is very high.

Hundred resistance Prorealtime

You need to implement this particular price knowledge in your automatic trading system.

The rounded price detection algorithm

A very simple algorithm allows you to know if the actual price of an asset ends by 100, 50, or 20 thanks to ROUND instruction.

hundred = ROUND(close / 100) * 100
fifty = ROUND(close / 50) * 50
twenty = ROUND(close / 20) * 20

Define the nearest hundred-round number as a target

After that, you can choose this price as a target. However, you should control the round price to be higher than the actual price. If the rounded price is lower than the actual price, you can just add 100 points at the actual price in case of a long position opening.

For example, if the actual price is 13244, the rounded price to the nearest hundred will be 13200; therefore, you must add 100 to obtain 13300.

// long position case
IF hundred < close THEN
    hundred = hundred + 100
ENDIF

After you verified the nearest hundred is higher than the actual price, you can define your TARGET.

pTargetHundred = hundred - close
SET TARGET pPROFIT pTargetHundred

If you decide to define your target price after you open a position, you should use the POSITIONPRICE instruction to compute your target price. POSITIONPRICE indicates the current average position price of all the opened orders.

pTargetHundred = hundred - POSITIONPRICE

Be careful. This example works for a long position, but if you want to open a short position, you must verify that the rounded price is lower than the actual price. If not, you must sub 100 points of the rounded price.

// short position case
IF hundred > close THEN
    hundred = hundred - 100
ENDIF
pTargetHundred = hundred - POSITIONPRICE

Choosing to determine your TARGET on the nearest rounded hundred when you trade an index such as the DAX strongly increases the success rate of your automatic trading system.

If you have any questions, please ask me in a comment. If this article pleased you, I would be grateful if you shared it. If you want to learn more about automated trading, please see our automated trading learning section.

Leave a Reply