RSI IBS in Variation – Problem with SL
Forums › ProRealTime English forum › ProOrder support › RSI IBS in Variation – Problem with SL
- This topic has 19 replies, 4 voices, and was last updated 6 years ago by
Marc.
Tagged: Debug
-
-
10/31/2018 at 1:57 PM #83867
Hi together,
pls find attached code.
For some reasons I want to have a secure SLWhen system is long this SL should trigger when MA10 < MA200
When system is short this SL should trigger when MA10 > MA200SL for Long is called SLL, SL for short is called SLS.
I think there is an issue with this EA…can somebody confirm if this coding is correct or not and help me to amend it?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051DEFPARAM CUMULATEORDERS = falseREM Money Management//Capital = 10000//Risk = 0.001 // Faktor für Kontraktgröße//StopLoss = 10 // StoppLossREM Calculate contracts//equity = Capital + StrategyProfit//maxrisk = round(equity*Risk)//x = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)x = 1//IndikatorenMM200 = average[200](close)MM10 = average[10](close)RSI2 =RSI[2]((close+high+low)/3)IBS = (Close-Low) / (High-Low) * 100//STOP LOSS SIGNAL//SLL = MM10 < MM200//SLS = MM10 > MM200//LONGca1 = close > MM200 AND MM200[1] < MM200[0]ca2 = RSI2 < a //DAX 9, BUND 6, S&P 8, EURUSD 10, Gold 6, WTI 10ca3 = IBS < b //DAX 9, BUND 10, S&P 8, EURUSD 8, Gold 10, WTI 10IF NOT LONGONMARKET AND ca1 and ca2 and ca3 THENBUY x CONTRACT at market NEXTBAROPENENDIF//EXIT LONGIF LONGONMARKET AND close > MM10 THENsell at market NEXTBAROPEN//SET STOP LOSS SLLENDIF//SHORTcv1 = close < MM200 AND MM200[1] > MM200 [0]cv2 = RSI2 > c //DAX 95, BUND 90, S&P 97, EURUSD 90, Gold 95, WTI 95cv3 = IBS > d //DAX 90, BUND 98, S&P 90, EURUSD 92, Gold 93, WTI 90IF NOT SHORTONMARKET AND cv1 and cv2 and cv3 THENSELLSHORT x CONTRACT at market NEXTBAROPENENDIF//EXIT SHORTIF SHORTONMARKET AND close < MM10 THENexitshort at market NEXTBAROPEN//SET STOP LOSS SLSENDIF10/31/2018 at 4:22 PM #83876Add these lines (or more if you need) at the end of your code to check the value retained by those variables each bar, as from the screenshot. This will help you discover errors:
123graph MM10graph MM200graph close10/31/2018 at 5:03 PM #8388510/31/2018 at 5:15 PM #8388711/01/2018 at 2:05 PM #8393911/01/2018 at 2:31 PM #8394311/01/2018 at 4:36 PM #8395111/01/2018 at 9:39 PM #8396511/01/2018 at 9:51 PM #8396611/01/2018 at 10:30 PM #8396811/01/2018 at 10:48 PM #8397011/01/2018 at 11:06 PM #8397211/01/2018 at 11:45 PM #8397411/01/2018 at 11:55 PM #8397611/02/2018 at 1:57 PM #84039One additional question…
How can I instert the feature to type in externaml parameters?
Pls see Screenshot below.
When playcing RSI I am able to change oversold and overbought zones within the code…I tried to add this feature to IBS…but it doesn’t work without changin paraemters in all other chartwindows
-
AuthorPosts
Find exclusive trading pro-tools on