Custom indicator for buy signal

I'm new at programming and AFL. Have studied tutorials. Managed to write a custom indicator and it plots correctly, (big first step). I can't get the syntax to use it as a buy signal. I have set up all the conditions and parameters of the signal in the code, but I can't figure out what syntax I need for the buy. This is a 1st grade question but I can't find the answer in the help menu. This is a RSI type signal. When todays close is 20 or more points above yesterdays close I want to buy. I tried a hundred things, this is my last effort. Thanks for any help.

Buy = vRSI(C) >=  20 + vRSI(C, -1);

Hi @mongoose, and welcome to the forum.

Please search for "Verified" or "Verified Badge" and follow the steps to get verified. You need to be verified to post question on the forum.

AB and AFL can be a challenge when getting started, but it is also amazingly powerful. Well worth the effort.

Let us know when you get verified and then hopefully we can guide you to a solution.

Thank you for the heads up. I got that taken care of. Do you know if I need to repost to get the badge to show up on the post. I don't see it on the post above.

Your badge is now displayed - all good.

Use Ref().

Thank you TrendSurfer. I had tried Ref() in my many efforts. I didn't get it to work. Got it now. This is harder than chemistry in college. Thanks again

@mongoose,

It can take a while for ALF to "click in", but keep plugging away.
Try this...

Buy = vRSI(c) >= 20 + Ref(vRSI(c),-1);
1 Like

Yes, it can take a while for him to click... :smiley:

Alf Watching TV (396 x 298)

1 Like

@ghanson

:grinning: :grinning: :grinning:

Thank you all for your help and input. Great community. With folks like you that freely give your time, newbie's like me have a chance to climb the AFL mountain.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.