OPEN-SOURCE SCRIPT
تم تحديثه Edge Reality Check - the win rate your R:R actually needs

Before you build a strategy, it is worth knowing whether the reward-to-risk you have in mind has ever been achievable on the instrument you are trading. Most people find out afterwards.
This measures it. From every bar in the sample it asks one question: did price travel the target distance before it travelled the stop distance? Counting the answers gives the hit rate that entering at random would have produced on this chart — and that is the number any entry signal has to beat.
WHAT THE TABLE SHOWS
Break-even win rate. What your reward-to-risk demands before anything else. At 2:1 that is 33.3%; at 1:2 it is 66.7%. Enter your spread and commission and it recalculates, because small edges usually die there.
The measured hit rate. Not a guess, not an assumption — what actually happened on this chart, over the sample you choose.
The margin between them. If random entries at 2:1 hit 29% here and you need 33.3%, your signal is not looking for an edge, it is clawing back a deficit. If random entries already clear break-even, your signal only has to avoid making things worse. Those are very different projects, and knowing which one you are on is worth ten minutes.
The losing run to expect. Given the measured hit rate and the number of samples, the longest run of losses that ordinary bad luck produces. People abandon working systems inside runs that were always going to happen.
NOTES ON METHOD
Stop and target can be sized from the ATR at each historical bar, so distances scale with the volatility of the time rather than today's.
If a single bar spans both the stop and the target there is no way to know which came first, so it counts as a loss. Being wrong pessimistically is the only honest way to resolve it.
Samples that reach neither level within the holding window are reported separately as timed out, not quietly dropped.
The table states the period the sample covers. Six hundred bars is two days on a 5m chart and two years on a daily one, and a percentage with no period attached invites more confidence than it has earned.
The figure describes the window, not the instrument. A trending period flatters one direction and punishes the other: gold on 1H measured 44.9% for longs over five trending weeks, and 28.1% on 5m over two choppy days. Run it across several windows before you believe any single number, and check whether the direction you are testing happened to be the way the market was going.
This is a baseline, not a backtest. It measures the instrument, not a strategy. A signal that beats it may still be worthless for other reasons — costs, overfitting, or a sample too small to mean anything.
WHAT IT IS NOT
It places no trades, gives no signals and predicts nothing. It tells you what the chart has already done.
Open source. Use it, change it, take it apart.
This measures it. From every bar in the sample it asks one question: did price travel the target distance before it travelled the stop distance? Counting the answers gives the hit rate that entering at random would have produced on this chart — and that is the number any entry signal has to beat.
WHAT THE TABLE SHOWS
Break-even win rate. What your reward-to-risk demands before anything else. At 2:1 that is 33.3%; at 1:2 it is 66.7%. Enter your spread and commission and it recalculates, because small edges usually die there.
The measured hit rate. Not a guess, not an assumption — what actually happened on this chart, over the sample you choose.
The margin between them. If random entries at 2:1 hit 29% here and you need 33.3%, your signal is not looking for an edge, it is clawing back a deficit. If random entries already clear break-even, your signal only has to avoid making things worse. Those are very different projects, and knowing which one you are on is worth ten minutes.
The losing run to expect. Given the measured hit rate and the number of samples, the longest run of losses that ordinary bad luck produces. People abandon working systems inside runs that were always going to happen.
NOTES ON METHOD
Stop and target can be sized from the ATR at each historical bar, so distances scale with the volatility of the time rather than today's.
If a single bar spans both the stop and the target there is no way to know which came first, so it counts as a loss. Being wrong pessimistically is the only honest way to resolve it.
Samples that reach neither level within the holding window are reported separately as timed out, not quietly dropped.
The table states the period the sample covers. Six hundred bars is two days on a 5m chart and two years on a daily one, and a percentage with no period attached invites more confidence than it has earned.
The figure describes the window, not the instrument. A trending period flatters one direction and punishes the other: gold on 1H measured 44.9% for longs over five trending weeks, and 28.1% on 5m over two choppy days. Run it across several windows before you believe any single number, and check whether the direction you are testing happened to be the way the market was going.
This is a baseline, not a backtest. It measures the instrument, not a strategy. A signal that beats it may still be worthless for other reasons — costs, overfitting, or a sample too small to mean anything.
WHAT IT IS NOT
It places no trades, gives no signals and predicts nothing. It tells you what the chart has already done.
Open source. Use it, change it, take it apart.
ملاحظات الأخبار
No change to the script itself.Adding a pointer, because this indicator's description raises a question it doesn't answer: the baseline is 33%, so does your filter beat it?
Filter Reality Check, also on my profile, answers that. Same engine, but it resolves every bar once and counts the outcome twice — into the baseline, and into the filtered set when your condition was true on that bar. Identical bars, identical distances, identical resolutions, so the gap between the two rates is the filter and nothing else.
Most filters turn out to be worth nothing. It says so plainly when that's the answer.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.