Home Systeemhandel Bericht

Trailing Stop met Vaste Parabolische SAR voor MetaTrader 5

Bijlage
39931.zip (3.98 KB, Downloaden 0 keer)

In deze blogpost bespreken we hoe je de Parabolische SAR kunt aanpassen om een directe specificatie van het startpunt mogelijk te maken. Dit kan je helpen bij het optimaliseren van je tradingstrategie.

Vaste Parabolische SAR


Parameters

parameters

  • Trailing Mode: Geen / Trailing Vast / Trailing Vast Parabolische SAR

Hier is de berekening van de Parabolische SAR:

bool CSampleExpert::LongModifiedEx(void) { bool res=false; //--- controleer op trailing stop if(m_trailing_max < m_last_bar.high) { double tp=m_position.TakeProfit(); double sl=m_position.StopLoss(); //--- bereken Parabolische SAR m_trailing_max = m_last_bar.high; m_trailing_step = fmin(InpPSAR_Maximum, m_trailing_step + InpPSAR_Step); double sar_stop = sl + (m_trailing_max - sl) * m_trailing_step; sar_stop=NormalizeDouble(sar_stop,m_symbol.Digits()); //--- if((sl==0.0 || sl < sar_stop) && sar_stop < m_symbol.Bid()) { //--- wijzig positie if(m_trade.PositionModify(Symbol(),sar_stop,tp)) printf("Long positie van %s wordt gewijzigd",Symbol()); else { printf("Fout bij wijziging van positie van %s : '%s'",Symbol(),m_trade.ResultComment()); printf("Wijzig parameters : SL=%f,TP=%f",sar_stop,tp); } //--- gewijzigd en moet expert verlaten res=true; } } //--- resultaat return(res); }

Gerelateerde berichten

Reactie (0)