Hello,
//--- check new resistance
double prevResistance = symbols[s].lastResistance;
symbols[s].lastResistance = SR(symbols[s].name,Timeframes[t].period,4,0);
//--- new resistance ?
if(prevResistance!=0 && prevResistance!=symbols[s].lastResistance)
{
symbols[s].newbar[t]=false;
//--- check price
if(SymbolInfoDouble(symbols[s].name,SYMBOL_ASK)<symbols[s].lastResistance)
symbols[s].SetPlacePending(1,-1,sparams[RS].currentMagic/100);
}
//--- check new support
double prevSupport = symbols[s].lastSupport;
symbols[s].lastSupport = SR(symbols[s].name,Timeframes[t].period,5,0);
//--- new support ?
if(prevSupport!=0 && prevSupport!=symbols[s].lastSupport)
{
symbols[s].newbar[t]=false;
//--- check price
if(SymbolInfoDouble(symbols[s].name,SYMBOL_BID)>symbols[s].lastSupport)
symbols[s].SetPlacePending(1,1,sparams[RS].currentMagic/100);
}
This currently , it places a sell limit on the resistance line and a buy limit on the support line,
Can someone tell me how to change this code so it places a buystop on that resistance line and a sellstop on that support line?
what part has to get changed
thanks in advance
Hi,
This snippet fragment isn't enough to give you an answer, and next time you post code please use the SRC button in the toolbar.
Forum on trading, automated trading systems and testing trading strategies
Alain Verleyen, 2014.02.11 17:59

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
This currently , it places a sell limit on the resistance line and a buy limit on the support line,
Can someone tell me how to change this code so it places a buystop on that resistance line and a sellstop on that support line?
what part has to get changed
thanks in advance