RSI and IBS based EA
Forums › ProRealTime Deutsch forum › ProOrder Support › RSI and IBS based EA
- This topic has 14 replies, 5 voices, and was last updated 6 years ago by Marc.
-
-
11/23/2017 at 10:32 AM #53697
Hi together,
I’d like to share my code with you and want to know if there is any mistake within this code?
Here are the rules for this system:
Enter Long when:
- When RSI with Period 2 is below or equal 10 on previous periods close
- When RSI with Period 2 is above or equal 10 at close of current periods close
- When IBS is below or equal 50 on previous periods close
- When IBS is above or equal 50 at close of current period
- Open Long at next bar open
Exit Long when:
- RSI rises above 80 at close of previous period, close position at next bar open
Enter Short when:
- When RSI with Period 2 is above or equal 90 on previous periods close
- When RSI with Period 2 is below or equal 90 at close of current periods close
- When IBS is above or equal 50 on previous periods close
- When IBS is below or equal 50 at close of current period
- Open Short at next bar open
Exit Short when:
- RSI falls below 20 at close of previous period, close position at next bar open
Here is the code:
//INDICATOR
IBS = (Close-Low) / (HIGH-LOW) * 100
RSI2 = RSI[2](close)//SIGNAL
IBSLONGTRIGGER = 50
IBSSHORTTRIGGER = 50RSILONGTRIGGER = 10
RSILONGEXIT = 80
RSISHORTTRIGGER = 90
RSISHORTEXIT = 20//ENTRY CONDITION
l1 = not LongOnMarket
l1 = l1 and IBS[1] >= IBSLONGTRIGGER[1] and IBS[2] <= IBSLONGTRIGGER[2] and RSI2[1] >= RSILONGTRIGGER[1] and RSI2[2] <= RSILONGTRIGGER[2]b1 = not ShortOnMarket
b1 = b1 and IBS[1] <= IBSSHORTTRIGGER[1] and IBS[2]>= IBSSHORTTRIGGER[2] and RSI2[1] <= RSISHORTTRIGGER[1] and RSI2[2] >= RSISHORTTRIGGER[2]//EXIT CONDITION
l2 = LongOnMarket
l2 = RSI2[1] >= RSILONGEXIT[1]b2 = ShortOnMarket
b2 = RSI2[1] <= RSISHORTEXIT[1]//LONG ENTRY
IF NOT LongOnMarket AND l1 THEN
BUY 1 CONTRACTS AT MARKET NextBarOPen
ENDIF//LONG EXIT
If LongOnMarket AND l2 THEN
SELL AT MARKET NextBarOpen
ENDIF//SHORT ENRTRY
IF NOT ShortOnMarket AND b1 THEN
SELLSHORT 1 CONTRACTS AT MARKET NextBarOpen
ENDIF//SHORT EXIT
IF ShortOnMarket AND b2 THEN
EXITSHORT AT MARKET NextBarOpen
ENDIF11/23/2017 at 11:03 AM #53699Code amended…
//INDICATOR
IBS = (Close-Low) / (HIGH-LOW) * 100
RSI2 = RSI[2](close)//SIGNAL
IBSLONGTRIGGER = 50
IBSSHORTTRIGGER = 50RSILONGTRIGGER = 10
RSILONGEXIT = 80
RSISHORTTRIGGER = 90
RSISHORTEXIT = 20//ENTRY CONDITION
l1 = not LongOnMarket
l1 = l1 and IBS[1] >= IBSLONGTRIGGER[1]
l1 = l1 and IBS[2] <= IBSLONGTRIGGER[2]
l1 = l1 and RSI2[1] >= RSILONGTRIGGER[1]
l1 = l1 and RSI2[2] <= RSILONGTRIGGER[2]b1 = not ShortOnMarket
b1 = b1 and IBS[1] <= IBSSHORTTRIGGER[1]
b1 = b1 and IBS[2]>= IBSSHORTTRIGGER[2]
b1 = b1 and RSI2[1] <= RSISHORTTRIGGER[1]
b1 = b1 and RSI2[2] >= RSISHORTTRIGGER[2]//EXIT CONDITION
l2 = LongOnMarket
l2 = l2 and RSI2[1] >= RSILONGEXIT[1]b2 = ShortOnMarket
b2 = b2 and RSI2[1] <= RSISHORTEXIT[1]//LONG ENTRY
IF l1 THEN
BUY 1 CONTRACTS AT MARKET NextBarOpen
ENDIF//LONG EXIT
If l2 THEN
SELL AT MARKET NextBarOpen
ENDIF//SHORT ENRTRY
IF b1 THEN
SELLSHORT 1 CONTRACTS AT MARKET NextBarOpen
ENDIF//SHORT EXIT
IF b2 THEN
EXITSHORT AT MARKET NextBarOpen
ENDIF11/23/2017 at 11:41 AM #5371511/23/2017 at 11:56 AM #5371811/23/2017 at 6:35 PM #5376111/23/2017 at 8:56 PM #53772Hey Mast,
folgendes ist mir aufgefallen:
12345678//ENTRY CONDITIONl1 = not LongOnMarketl2 = l1 and IBS[1] >= IBSLONGTRIGGER[1]l3 = l2 and IBS[2] <= IBSLONGTRIGGER[2]l4 = l3 and RSI2[1] >= RSILONGTRIGGER[1]l5 = l4 and RSI2[2] <= RSILONGTRIGGER[2][...]Meinst Du soetwas?
11/23/2017 at 9:36 PM #53775Hallo zusammen, also natürlich möchte ich möglichst beliebige Instrumente handeln. Den TF sehe ich bei 1h, 4h und 1D, wobei es interessant wäre dies auch unter 2h zu testen.
Sicher würde es, je nach Instrument dann auch Sinn machen Zeiten fest zu legen wann gehandelt werden soll.
Aktuell nutze ich eine Demo mit EOD Daten und wollte mal die 14 Tage Version nutzen um eben kleinere TF zu testen.
bzgl des codeschnipsels muss ich mich mal rein denken…habe gestern erst angefangen mich mit prorealcode zu befassen.
vg marc
11/24/2017 at 8:50 AM #53795Ich habe übrigens den Code ein wenig geändert…
Hier ist nun ein MA-Filter drin:
//INDICATOR
IBS = (Close-Low) / (HIGH-LOW) * 100
RSI2 = RSI[2](close)
MA = average[maperiod](close)//CONTRACTSIZE
X = 10//MOVING AVERAGE PERIOD
maperiod = 144//SIGNAL
IBSLONGTRIGGER = 50
IBSSHORTTRIGGER = 50RSILONGTRIGGER = 10
RSILONGEXIT = 80
RSISHORTTRIGGER = 90
RSISHORTEXIT = 20//ENTRY CONDITION
l1 = NOT LongOnMarket
l1 = l1 and IBS > IBSLONGTRIGGER
l1 = IBS[1] < IBSLONGTRIGGER[1]
l1 = l1 and RSI2 > RSILONGTRIGGER
l1 = RSI2[1] < RSILONGTRIGGER[1]
l1 = l1 and low[1] > MAb1 = NOT ShortOnMarket
b1 = b1 and IBS < IBSSHORTTRIGGER
b1 = IBS[1] > IBSSHORTTRIGGER[1]
b1 = b1 and RSI2 < RSISHORTTRIGGER
b1 = RSI2[1] > RSISHORTTRIGGER[1]
b1 = b1 and high [1] < MA//EXIT CONDITION
l2 = LongOnMarket
l2 = RSI2 > RSILONGEXITb2 = ShortOnMarket
b2 = RSI2 < RSISHORTEXIT//LONG ENTRY
IF l1 THEN
BUY X CONTRACTS AT MARKET NextBarOpen
ENDIF//LONG EXIT
If l2 THEN
SELL X CONTRACTS AT MARKET NextBarOpen
ENDIF//SHORT ENTRY
IF b1 THEN
SELLSHORT X CONTRACTS AT MARKET NextBarOpen
ENDIF//SHORT EXIT
IF b2 THEN
EXITSHORT AT MARKET NextBarOpen
ENDIF11/24/2017 at 12:21 PM #53846RSI IBS1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162DEFPARAM CumulateOrders = True//INDICATORIBS = (Close-Low) / (HIGH-LOW) * 100RSI2 = RSI[2](close)MA = average[maperiod](close)//CONTRACTSIZEX = 1//MOVING AVERAGE PERIODmaperiod = 200//SIGNALIBSLONGTRIGGER = 50IBSSHORTTRIGGER = 50RSILONGTRIGGER = 10RSILONGEXIT = 80RSISHORTTRIGGER = 90RSISHORTEXIT = 20//ENTRY CONDITIONl1 = NOT LongOnMarketl1 = l1 and IBS > IBSLONGTRIGGERl1 = IBS[1] < IBSLONGTRIGGER[1]l1 = l1 and RSI2 > RSILONGTRIGGERl1 = RSI2[1] < RSILONGTRIGGER[1]l1 = l1 and low[1] > MAb1 = NOT ShortOnMarketb1 = b1 and IBS < IBSSHORTTRIGGERb1 = IBS[1] > IBSSHORTTRIGGER[1]b1 = b1 and RSI2 < RSISHORTTRIGGERb1 = RSI2[1] > RSISHORTTRIGGER[1]b1 = b1 and high [1] < MA//EXIT CONDITIONl2 = LongOnMarketl2 = RSI2 > RSILONGEXITb2 = ShortOnMarketb2 = RSI2 < RSISHORTEXIT//LONG ENTRYIF l1 THENBUY X CONTRACTS AT MARKET NextBarOpenENDIF//LONG EXITIf l2 THENSELL X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT ENTRYIF b1 THENSELLSHORT X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT EXITIF b2 THENEXITSHORT AT MARKET NextBarOpenENDIF1 user thanked author for this post.
11/24/2017 at 7:28 PM #5387611/28/2017 at 10:34 AM #54236Hallo axmichi,
Berauschend ist das nicht…wahrscheinlich ist 1 Minute klein als TF um da wirklich aussagekräftige Ergebnisse zu bekommen. Im Dax lief es beim Taily TF ganz gut mit einem ordentlichen PF von 3,96.
ich habe mal die trialversiob mit Echtzeitdaten bzw. den untertägigen Daten freischalten lassen und teste es mal heute selber aus.
Das Grundgerüst dieses Systems beruht auf der Idee von Larry Williams RSI2a-Strategie.
vg Marc
11/28/2017 at 11:09 AM #5424411/28/2017 at 1:53 PM #54259Du weißt das du traillingstops usw, nicht mehr verwenden brauchst, da sie nicht mehr greifen, akzeptiert werden. Thema garantierte Stops
Auf Stopps habe ich mich seltenst verlassen dürfen. Ich benutze da lieber valide Signale…wie im o.g. System
07/26/2018 at 3:56 PM #76827Gedächtnisstütze:
Einige Parameter angepasst:
RSI Close mit HA-Berechnung1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162DEFPARAM CumulateOrders = false//INDICATORIBS = (close-Low) / (HIGH-LOW) * 100RSI2 = RSI[2]((open+close+low+high)/4)MA = average[maperiod](close)//CONTRACTSIZEX = 1//MOVING AVERAGE PERIODmaperiod = 200//SIGNALIBSLONGTRIGGER = 50IBSSHORTTRIGGER = 50RSILONGTRIGGER = 10RSILONGEXIT = 80RSISHORTTRIGGER = 95RSISHORTEXIT = 50//ENTRY CONDITIONl1 = NOT LongOnMarketl1 = l1 and IBS > IBSLONGTRIGGERl1 = IBS[1] < IBSLONGTRIGGER[1]l1 = l1 and RSI2 > RSILONGTRIGGERl1 = RSI2[1] < RSILONGTRIGGER[1]l1 = l1 and low[1] > MAb1 = NOT ShortOnMarketb1 = b1 and IBS < IBSSHORTTRIGGERb1 = IBS[1] > IBSSHORTTRIGGER[1]b1 = b1 and RSI2 < RSISHORTTRIGGERb1 = RSI2[1] > RSISHORTTRIGGER[1]b1 = b1 and high [1] < MA//EXIT CONDITIONl2 = LongOnMarketl2 = RSI2 > RSILONGEXITb2 = ShortOnMarketb2 = RSI2 < RSISHORTEXIT//LONG ENTRYIF l1 THENBUY X CONTRACTS AT MARKET NextBarOpenENDIF//LONG EXITIf l2 THENSELL X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT ENTRYIF b1 THENSELLSHORT X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT EXITIF b2 THENEXITSHORT AT MARKET NextBarOpenENDIF08/08/2018 at 3:42 PM #77781here antoher code with some variables for testing.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859DEFPARAM CumulateOrders = false//INDICATORIBS = (close-Low) / (HIGH-LOW) * 100RSI2 = RSI[RSIPeriod]((open+close+low+high)/4)MA = average[MAPeriod](close)//CONTRACTSIZEX = 1//SIGNALIBSLONGTRIGGER = 50IBSSHORTTRIGGER = 50RSILONGTRIGGER = RSILTRSILONGEXIT = RSILERSISHORTTRIGGER = RSISTRSISHORTEXIT = RSISE//ENTRY CONDITIONl1 = NOT LongOnMarketl1 = l1 and IBS > IBSLONGTRIGGERl1 = IBS[1] < IBSLONGTRIGGER[1]l1 = l1 and RSI2 > RSILONGTRIGGERl1 = RSI2[1] < RSILONGTRIGGER[1]l1 = l1 and low[1] > MAb1 = NOT ShortOnMarketb1 = b1 and IBS < IBSSHORTTRIGGERb1 = IBS[1] > IBSSHORTTRIGGER[1]b1 = b1 and RSI2 < RSISHORTTRIGGERb1 = RSI2[1] > RSISHORTTRIGGER[1]b1 = b1 and high [1] < MA//EXIT CONDITIONl2 = LongOnMarketl2 = RSI2 > RSILONGEXITb2 = ShortOnMarketb2 = RSI2 < RSISHORTEXIT//LONG ENTRYIF l1 THENBUY X CONTRACTS AT MARKET NextBarOpenENDIF//LONG EXITIf l2 THENSELL X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT ENTRYIF b1 THENSELLSHORT X CONTRACTS AT MARKET NextBarOpenENDIF//SHORT EXITIF b2 THENEXITSHORT AT MARKET NextBarOpenENDIF -
AuthorPosts