KST (Know Sure Thing) oscillator

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
A while ago i got interested in this oscillator originally developed by Martin J. Pring.

To get notified i added signalline crossover alert and zeroline crossover alert.

The former seems to work well, but the latter doesn't give an alert when the zeroline is crossed.

When i added the alert lines initially i did get several errors, so i added the integers on line 98 as well.

I think the issue is which integer from this line i need to add on line 263 and 272, but am not sure.
Can somebody please look into this?
 

Attachments

  • KST_KnowSureThing v1.2.mq4
    20.1 KB · Views: 26
Last edited:

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
Makes sense what you stated.

I changed it now, and it seems to work.
But i have my doubt if it's really good?
Can you have a sneak peak at?

Can you also enlighten me what integers i should put on the end of line 263 and 272, i added (c), but that was my non-coder logic... :)
 

Attachments

  • KST_KnowSureThing v1.2.mq4
    20.1 KB · Views: 24

Enivid

Administrator
Staff member
Nov 30, 2008
18,534
1,355
144
Odesa
www.earnforex.com
Should be checking Bars against 'd', not 'c' on line 272:
MQL4:
      if ((KST[0] > 0) && (SignalBuffer[0] <= 0) && (Bars > c))
The logic here is to prevent more than one alert per bar popping up.

As for the logic of the alert conditions, I have no idea. Launch it in a visual backtest see.
 

boa_conflictor

Master Trader
Aug 5, 2016
75
9
69
Is there a way to code the alerts in a way that once a crossing of signal line and/or zero line has occured the next alert will only be send once the next crossing occurs?
Right now the alerts are send every time i start mt4, also for crossings which occured several bars ago.

I searched for it but could not find the proper info?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,534
1,355
144
Odesa
www.earnforex.com
Yes, when you are checking for crossing, you have to check that the current value is above/below the threshold level and the previous value is below/above that level. That way, the next bar after crossing occurs will not qualify for an alert unless there is a new crossing at that time.