I’ve seen all of your videos, and first off I want to say thank you!! I’ve just started in the market, not fully established yet, but getting very close especially with your help setting TOS up. I promise once I acquire capital you’ll see my thanks in contribution. Before my question a side question, is there a way to attach other sounds instead of using the TOS standard sounds? With so many alerts its hard to differentiate each sound when they’re all similar..
As for my question: What is the normal code (one I could use on others as well) used to make alerts sound off and show up. I know the basics of coding, so if you can easily attempt to inform me for future reference how to set it for others also great, if not that’s okay too. I’ve attempted to just copy and paste to use on the indicator I’m trying to use but it’s in error. I want it to alert me when the bar comes into immediate contact with a parabolic bar. The indicator is a parabolic custom as pasted:
input direction = {default “Long”};
input accelerationFactor = 0.02;
input accelerationLimit = 0.2;
assert(accelerationFactor > 0, “‘acceleration factor’ must be positive: ” + accelerationFactor);
assert(accelerationLimit >= accelerationFactor, “‘acceleration limit’ (” + accelerationLimit + “) must be greater than or equal to ‘acceleration factor’ (” + accelerationFactor + “)”);
def state = {default init, long, short};
def extreme;
def SAR;
def acc;
switch (state[1]) {
case init:
state = state.long;
acc = accelerationFactor;
extreme = high;
SAR = low;
case short:
if (SAR[1] < high)
then {
state = state.long;
acc = accelerationFactor;
extreme = high;
SAR = extreme[1];
} else {
state = state.short;
if (low < extreme[1])
then {
acc = min(acc[1] + accelerationFactor, accelerationLimit);
extreme = low;
} else {
acc = acc[1];
extreme = extreme[1];
}
SAR = max(max(high, high[1]), SAR[1] + acc * (extreme – SAR[1]));
}
case long:
if (SAR[1] > low)
then {
state = state.short;
acc = accelerationFactor;
extreme = low;
SAR = extreme[1];
} else {
state = state.long;
if (high > extreme[1])
then {
acc = min(acc[1] + accelerationFactor, accelerationLimit);
extreme = high;
} else {
acc = acc[1];
extreme = extreme[1];
}
SAR = min(min(low, low[1]), SAR[1] + acc * (extreme – SAR[1]));
}
}
plot parSAR = SAR;
parSAR.SetPaintingStrategy(PaintingStrategy.POINTS);
parSAR.SetDefaultColor(GetColor(5));
# Alerts:
#
def alerttrigger= if direction[1]<=0 and longswitch then 1
else if direction[1]>=0 and shortswitch then 1 else 0;
input alerttext=”Alert Text”;
# BLOCK CODE BELOW
input UseAlerts = {false, default true};
input AlertType = {default “BAR”, “ONCE”, “TICK”};
def at=AlertType;
input AlertSound = {“Bell”, “Chimes”, default “Ding”, “NoSound”, “Ring”};
alert(alerttrigger AND UseAlerts, alerttext, if at==1 then Alert.ONCE else if at==2 then Alert.TICK else Alert.BAR, AlertSound);
Like this:
Like Loading...