start trading 09:00:00 – CCI trading strategy
Forums › ProRealTime English forum › ProOrder support › start trading 09:00:00 – CCI trading strategy
- This topic has 4 replies, 2 voices, and was last updated 8 years ago by Nicolas.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
08/25/2016 at 12:33 PM #12208
this is my code trade the cci strategy
but i will start directly at 09:00:00 in the same direction from the cci , when the price below the cci -100 we start short, when the price above the 100
we start long.
tks
luc
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869// Definition of code parameters//"START CCI "//X MINIMAL VALUE 14 MAXIMAL VALUE 70 STEP 2//ORDER FEE =2.5€//starting date = 18 jul 20116 01:00:00//ending date = real time dateDEFPARAM CumulateOrders = true// Cumulating positions deactivatedDEFPARAM FLATBEFORE=090000DEFPARAM FLATAFTER=120000dayprofitmax=1500daylossmax=195if intradaybarindex=0 thentrading=1lastdayprofit=strategyprofitendifif trading=1 thenif (not onmarket and (strategyprofit > lastdayprofit+dayprofitmax or strategyprofit < lastdayprofit-daylossmax)) or (longonmarket and (strategyprofit+((close-tradeprice)/pointsize*countoflongshares*pointvalue) > lastdayprofit+dayprofitmax or strategyprofit+((close-tradeprice)/pointsize*countoflongshares*pointvalue) < lastdayprofit-daylossmax)) or (shortonmarket and (strategyprofit+((tradeprice-close)/pointsize*countofshortshares*pointvalue) > lastdayprofit+dayprofitmax or strategyprofit+((tradeprice-close)/pointsize*countofshortshares*pointvalue) < lastdayprofit-daylossmax)) thentrading=0//sell at market//exitshort at marketQUITendifendif// Conditions to enter long positionsindicator1 = CCI[50]c1 = (indicator1 CROSSES OVER -100)//c11 = (indicator1 CROSSES OVER 100)IF c1 THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator2 = CCI[50]c2 = (indicator2 CROSSES UNDER 100)//c21 = (indicator2 CROSSES UNDER -100)IF c2 THENSELL AT MARKETENDIF// Conditions to enter short positionsindicator3 = CCI[50]c3 = (indicator3 CROSSES UNDER 100)//c31 = (indicator3 CROSSES UNDER -100)IF c3 THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Conditions to exit short positionsindicator4 = CCI[50]c4 = (indicator4 CROSSES OVER -100)//c41 = (indicator4 CROSSES OVER 100)IF c4 THENEXITSHORT AT MARKETENDIF// Stops and targets//SET STOP $LOSS 100//set stop $loss 100 trailing 50//if strategyprofit < -150 then//quit//endif//if strategyprofit > 1000 then//quit//endif//set stop trailing 1208/25/2016 at 4:23 PM #1221508/25/2016 at 5:31 PM #1222108/25/2016 at 5:32 PM #1222212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152/ Definitie van code parametersDEFPARAM CumulateOrders = false// Opstapelen posities gedeactiveerdDEFPARAM FLATBEFORE=090000DEFPARAM FLATAFTER=120000dayprofitmax=1500daylossmax=190if intradaybarindex=0 thentrading=1lastdayprofit=strategyprofitendifif trading=1 thenif (not onmarket and (strategyprofit > lastdayprofit+dayprofitmax or strategyprofit < lastdayprofit-daylossmax)) or (longonmarket and (strategyprofit+((close-tradeprice)/pointsize*countoflongshares*pointvalue) > lastdayprofit+dayprofitmax or strategyprofit+((close-tradeprice)/pointsize*countoflongshares*pointvalue) < lastdayprofit-daylossmax)) or (shortonmarket and (strategyprofit+((tradeprice-close)/pointsize*countofshortshares*pointvalue) > lastdayprofit+dayprofitmax or strategyprofit+((tradeprice-close)/pointsize*countofshortshares*pointvalue) < lastdayprofit-daylossmax)) thentrading=0//sell at market//exitshort at marketQUITendifendif//indist = SuperTrend[2.8,5]//resetting variableonce lasttrade = 0IF LONGONMARKET thenlasttrade = 1elsif SHORTONMARKET thenlasttrade = -1elsif hour<9 OR hour>12 thenlasttrade = 0endif// Condities om long posities te openenIF close>st AND lasttrade<>1 THENEXITSHORT AT MARKETif trading>0 thenBUY 1 LOT AT MARKET nextbaropenendifENDIF// Condities om long posities te sluitenIF close<st AND lasttrade<>-1 THENSELL AT MARKETif trading>0 thenSELLSHORT 1 lot at market nextbaropenendifENDIF//set stop $loss 100 trailing 50//SET STOP $TRAILING 50SET STOP $loss 100yes, you make also this code entry for the supertrend
08/26/2016 at 10:36 AM #12239 -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)