GordonR

Help needed with strategy - Entry is off by 2 candles

Hi,

I'm new to TradingView, and would greatly appreciate some help with figuring out where I'm going wrong with this script.

This is a overly simplified version of what I'm actually trying to do, but hopefully it's easier to see the problem.

Here I'd like to create a Buy signal when the fast moving average crosses over the slow moving average, and Sell when the reverse happens.


If I draw arrows when the condition is met then they are one candle later than expected (probably because I'm using the closing values ??).
That not great, but workable.

My real problem comes when I try turning this into a strategy.
Now the signal only triggers 2 candles after the crossover.

What am I doing wrong here?

Thanks,
Gordon
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟