OPEN-SOURCE SCRIPT
Scalping London New York Strategy

Scalping London New York SMA Nanpin Strategy is a short-term forex backtesting strategy based on moving average trend direction, candle direction, session filtering, and averaging-down entries.
The strategy uses a fast and slow Simple Moving Average to determine the market direction. A long entry is generated when the previous confirmed candle is bullish and the fast SMA is above the slow SMA. A short entry is generated when the previous confirmed candle is bearish and the fast SMA is below the slow SMA.
The strategy includes a time filter, optional long-only mode, optional short-side averaging, fixed stop loss and take profit distances, and up to 10 pyramiding entries to approximate the original averaging-down logic. On a 5-minute chart, the moving average periods are automatically adjusted to approximate the original lower-timeframe settings.
Default settings:
Fast SMA: 60
Slow SMA: 280
Max Positions: 10
Stop Loss Request: 4.0
Take Profit Request: 5.0
Nanpin Step Request: 0.2
Time Filter: Enabled
Start Hour: 7
End Hour: 17
Only Long: Disabled
Short Nanpin: Enabled
Pyramiding: 10
Recommended timeframes: M1 and M5
Recommended market: Forex, especially JPY pairs such as USDJPY
The strategy closes an opposite position when an opposite signal appears. If a position is already open and price moves against the latest entry by the configured nanpin step, the strategy can add another entry up to the maximum position limit.
Because TradingView’s broker emulator differs from MT4/MT5 execution, backtest results may not match EA results or live broker execution exactly. Averaging-down strategies can increase risk significantly, especially during strong one-directional trends.
This script is intended for chart analysis, backtesting support, research, and educational purposes only.
It does not guarantee future performance and should not be considered financial advice.
Please test carefully before using it in any trading decision.
The strategy uses a fast and slow Simple Moving Average to determine the market direction. A long entry is generated when the previous confirmed candle is bullish and the fast SMA is above the slow SMA. A short entry is generated when the previous confirmed candle is bearish and the fast SMA is below the slow SMA.
The strategy includes a time filter, optional long-only mode, optional short-side averaging, fixed stop loss and take profit distances, and up to 10 pyramiding entries to approximate the original averaging-down logic. On a 5-minute chart, the moving average periods are automatically adjusted to approximate the original lower-timeframe settings.
Default settings:
Fast SMA: 60
Slow SMA: 280
Max Positions: 10
Stop Loss Request: 4.0
Take Profit Request: 5.0
Nanpin Step Request: 0.2
Time Filter: Enabled
Start Hour: 7
End Hour: 17
Only Long: Disabled
Short Nanpin: Enabled
Pyramiding: 10
Recommended timeframes: M1 and M5
Recommended market: Forex, especially JPY pairs such as USDJPY
The strategy closes an opposite position when an opposite signal appears. If a position is already open and price moves against the latest entry by the configured nanpin step, the strategy can add another entry up to the maximum position limit.
Because TradingView’s broker emulator differs from MT4/MT5 execution, backtest results may not match EA results or live broker execution exactly. Averaging-down strategies can increase risk significantly, especially during strong one-directional trends.
This script is intended for chart analysis, backtesting support, research, and educational purposes only.
It does not guarantee future performance and should not be considered financial advice.
Please test carefully before using it in any trading decision.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.