I have an efs formula started in formula to go Long in the trade, but am unsure how how to add my sell signal so my backtesting results work.
here is what a have to enter a buy signal:
if (
vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
) onAction1();
What I thought might work to get the opposite sell signal, would be this:
if (
vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
) onAction1(); //buy
if (
vStoch25_3.getValue(StochStudy.SLOW) < 80 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) > 80
) onAction2(); //sell
all indicators disappear when I do that so not what to do
here is what a have to enter a buy signal:
if (
vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
) onAction1();
What I thought might work to get the opposite sell signal, would be this:
if (
vStoch25_3.getValue(StochStudy.SLOW) > 20 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) < 20
) onAction1(); //buy
if (
vStoch25_3.getValue(StochStudy.SLOW) < 80 &&
vStoch25_3.getValue(StochStudy.SLOW, -1) > 80
) onAction2(); //sell
all indicators disappear when I do that so not what to do
Comment