Candlestick Scalper 1s discussion
Forums › ProRealTime English forum › ProOrder support › Candlestick Scalper 1s discussion
- This topic has 171 replies, 16 voices, and was last updated 2 years ago by CMM.
-
-
08/28/2020 at 2:14 PM #142830
Shorts again
I think the shorts version was the same code reversed with a supertrend of 12,3 it restricted th elongs as well but if you just write it for the shorts and keep longs the same likely it will work better, only a few trades mind but no losses… I’ll look to refine that on weekends, so maybe something popping up after I’ve had time to peruse it by Monday..
08/28/2020 at 7:31 PM #142861Here’s a mod for increasing and decreasing the trade amount based on profit and losses, comments welcomed. I put up the code for the trade amount managment here:
https://www.prorealcode.com/topic/increase-and-decrease-trade-amount-with-profit-and-loss/
And here is the code mod for longs with trade amount management and absolute loss shutdown (think I go tthat bit correct) let me know if not.
Longs with trade amount management for increased profits123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// Main code : Makside 1 min test code timed modified by Philip Penny https://philstrading.uk//-------------------------------------------------------------------------Defparam cumulateorders = falsetd1 = 1 AND OpenDayOfWeek = 1 AND OpenTime >= 070000 AND OpenTime <= 205500 //Mondaytd2 = 1 AND OpenDayOfWeek = 2 AND OpenTime >= 070000 AND OpenTime <= 205500 //Tuesdaytd3 = 1 AND OpenDayOfWeek = 3 AND OpenTime >= 070000 AND OpenTime <= 205500 //Wednesdaytd4 = 1 AND OpenDayOfWeek = 4 AND OpenTime >= 070000 AND OpenTime <= 205500 //Thursdaytd5 = 1 AND OpenDayOfWeek = 5 AND OpenTime >= 070000 AND OpenTime <= 205500 //FridaytdCond = td1 OR td2 OR td3 OR td4 OR td5//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : CANDLE//-------------------------------------------------------------------------Mystartamount = 1 //your risk tolerance start amount based on stoplossSL=300// your stoplosstp=28 //your take profit levelmydiv=2 //factor by which ot increase the trade amount by to limit stoploss but increase it with profits safely which will depend on stopout factorsMyabsloss=0x=strategyprofit/(SL*mystartamount)If strategyprofit<=(SL*mystartamount) thenMyamount=mystartamountEndifIf x>=2 then //x=the factor to increase risk calculation by when the profit has reached the stoploss multiple of xmyamount=(x*((mystartamount/mydiv)))//(x*mystartamount/2) is exponential growth and keeps stoploss at less than profits when profits above SL*2.endiftimeframe(15 minute,updateonclose)c160m = open > open[1] and close > close[1] and close > opentimeframe(1 minute,updateonclose)c11m = open > open[1] and close > close[1]c21m = abs(close-open) >= 16c31m = abs(close[1]-open[1])c41m = c31m > c21mtimeframe(default)c1def = open > open[1] and close > close[1]c2def = abs(close-open) >= 1IF not longonmarket and c1def and c11m and c21m and c41m and c2def and c1def and c160m and Close crosses over Supertrend[12,4] and tdcond thenBUY Myamount contracts at marketset stop ploss SLSet target pprofit tpENDIFIf strategyprofit<myabsloss thenquitendif08/28/2020 at 7:44 PM #142864Just to note for a £1 value I put -150 for absloss but can be any tolerance and the timezone is for UK
09/02/2020 at 9:23 AM #14318409/03/2020 at 9:18 AM #143266everythink is possible… we should already make a long version that works… currently, it’s not the case.. few trades (one or two trades) can lose all gains
Idea is to have a cash machine with some small gains quickly and very little on the market. It was the first idea of this bot
I’m currently working on another version of 1s system based on half pivots
09/03/2020 at 9:58 AM #143272everythink is possible… we should already make a long version that works… currently, it’s not the case.. few trades (one or two trades) can lose all gains
Idea is to have a cash machine with some small gains quickly and very little on the market. It was the first idea of this bot
I’m currently working on another version of 1s system based on half pivots
I’m currently running a number of combinations of filters but will need around 3 months at least to test those with any degree of usefulness at all.. I’ll post them in an excell file or something each month. Below is a code I’m runing live with minimal risk of £100 or so. whilst it doesnt make a fortune if you risk manage the code for the max loss you want to tolerate, so if you have £20K say you could risk £200 or £400 for a 1 or 2 % overall risk of the program, that would be “myamount=0.66 or 1.32” then you can put your quit amount in accordingly. The code below has a 100% result over 7 months or so, data is limiting at the moment, So I’ve stuck it up live with an overall risk of £100 fo rth eprogram in total, and the amount traded will increase once the profit is sufficient and then reset itself to its start amount. Yes this could stop you out more, but then the risk is reduced again. Based on the 100% gains this did as well as the orignal trail give or take, and simply has a TP of 28.. Currently the others are doing OK for at least 2 of them, however the loger term picture may be different as you say due to the risk management of 300 pips being excessive if stopped out. If you get some good programs making smaller amounts and have more of them, your yearly profit will likely increase..
3 posts above I put up an attachment of the backtest – Currently its traded twice in a week, so if it does OK I will likely increase overallrisk to £200 once up to £100 profit and that will increase duration of the risk but double the profits and then just leave run and see how it goes. Have that live at the mo as its risk managed and a marginal amount for me.
Hope that helps
Risk management123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// Main code : Makside 1 min test code timed modified by Philip Penny https://philstrading.uk//-------------------------------------------------------------------------Defparam cumulateorders = falsetd1 = 1 AND OpenDayOfWeek = 1 AND OpenTime >= 070000 AND OpenTime <= 205500 //Mondaytd2 = 1 AND OpenDayOfWeek = 2 AND OpenTime >= 070000 AND OpenTime <= 205500 //Tuesdaytd3 = 1 AND OpenDayOfWeek = 3 AND OpenTime >= 070000 AND OpenTime <= 205500 //Wednesdaytd4 = 1 AND OpenDayOfWeek = 4 AND OpenTime >= 070000 AND OpenTime <= 205500 //Thursdaytd5 = 1 AND OpenDayOfWeek = 5 AND OpenTime >= 070000 AND OpenTime <= 205500 //FridaytdCond = td1 OR td2 OR td3 OR td4 OR td5//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : CANDLE//-------------------------------------------------------------------------Mystartamount = 0.33 //your risk tolerance start amount based on stoplossSL=300// your stoplosstp=28 //your take profit levelmydiv=2 //factor by which ot increase the trade amount by to limit stoploss but increase it with profits safely which will depend on stopout factorsMyabsloss=-99x=strategyprofit/(SL*mystartamount)If strategyprofit<=(SL*mystartamount) thenMyamount=mystartamountEndifIf x>=2 then //x=the factor to increase risk calculation by when the profit has reached the stoploss multiple of xmyamount=(x*((mystartamount/mydiv)))//(x*mystartamount/2) is exponential growth and keeps stoploss at less than profits when profits above SL*2.endiftimeframe(15 minute,updateonclose)c160m = open > open[1] and close > close[1] and close > opentimeframe(1 minute,updateonclose)c11m = open > open[1] and close > close[1]c21m = abs(close-open) >= 16c31m = abs(close[1]-open[1])c41m = c31m > c21mtimeframe(default)c1def = open > open[1] and close > close[1]c2def = abs(close-open) >= 1IF not longonmarket and c1def and c11m and c21m and c41m and c2def and c1def and c160m and Close crosses over Supertrend[12,4] and tdcond thenBUY Myamount contracts at marketset stop ploss SLSet target pprofit tpENDIFIf strategyprofit<myabsloss thenquitendif09/03/2020 at 4:33 PM #14331409/03/2020 at 6:35 PM #143317No the 1 second version cant be backtested because of data limitation, so you don’t know its reliability without forward testing on demo. So minimum of 3 months testing, probably have better idea after 6 months of testing.. Sometimes you just gotta play the long game…
09/04/2020 at 12:03 PM #143371We need to get the Shorts working without reducing profit on Longs??
Anybody done any work on a Short Version of this Algo please?
09/04/2020 at 1:40 PM #143381I’ll have another look on weekend, original version was with excessive losses, I’ll have to backtest on minute only due to data though, I recall I had a brief look and whils tit remained 100% I think it took all traades out bar 3.. hmm.. I just reversed the coding for hsorts I think found it with excessive losses and started looking at filters, to reduce liklihood of losses..
Maybe look at my reversal code, may have got it wrong, have to dig it out.. Haven’t been back to it to be honest.. here the code is reversed I think, and the supertrend values changes, tweaking them can amend losses, but I haven’t looked at this enough yet and this is just for the reversed code to look at filters to reduce liklihood of losing trades..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Defparam cumulateorders = falsetd1 = 1 AND OpenDayOfWeek = 1 AND OpenTime >= 070000 AND OpenTime <= 205500 //Mondaytd2 = 1 AND OpenDayOfWeek = 2 AND OpenTime >= 070000 AND OpenTime <= 205500 //Tuesdaytd3 = 1 AND OpenDayOfWeek = 3 AND OpenTime >= 070000 AND OpenTime <= 205500 //Wednesdaytd4 = 1 AND OpenDayOfWeek = 4 AND OpenTime >= 070000 AND OpenTime <= 205500 //Thursdaytd5 = 1 AND OpenDayOfWeek = 5 AND OpenTime >= 070000 AND OpenTime <= 205500 //FridaytdCond = td1 OR td2 OR td3 OR td4 OR td5//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : CANDLE//-------------------------------------------------------------------------n = 0.33timeframe(15 minute,updateonclose)c160m = open > open[1] and close > close[1] and close > open//shortc160b = open < open[1] and close < close[1] and close < opentimeframe(1 minute,updateonclose)c11m = open > open[1] and close > close[1]c21m = abs(close-open) >= 16c31m = abs(close[1]-open[1])c41m = c31m > c21m//shortc11b = open < open[1] and close < close[1]c21b = abs(open-close) >= 2c31b = abs(open[1]-close[1])c41b = c31b < c21btimeframe(default)c1def = open > open[1] and close > close[1]c2def = abs(close-open) >= 1//shortc1defb = open < open[1] and close < close[1]c2defb = abs(open-close) >= 1IF not longonmarket and c1def and c11m and c21m and c41m and c2def and c1def and c160m and Close crosses over Supertrend[12,3] and tdcond thenBUY N contracts at marketset stop ploss 300ENDIF//shortIF not shortonmarket and c1defb and c11b and c21b and c41b and c2defb and c1defb and c160b and Close crosses under Supertrend[12,3] and tdcond thensellshort N contracts at marketset stop ploss 300ENDIFtp=28Set target pprofit tp09/04/2020 at 1:52 PM #143384You will see on th eattachment that my chaos addition is soaring ahead, those 2 are both teh 1 minute, but the one doing well is ran on the 1 second chart adding some chaos into the mix cos the program reacts differently when ran on LTFs believe it or not… so Chaos works.. 🙂 maybe cos the programmers working against you cant foretell it.. hmmm. who knows
Just added that out of interest really.. thats the original 1 minute code ran on a 1 second chart, they both the same code, the 1 second code nowhere near that..
1 user thanked author for this post.
09/06/2020 at 1:55 PM #143464So not much changed, but when I was looking at a simple way to get rid of losses I noted that changing the c21b to 5 and changing supertrend to 12,2 changed the in-trade drawdown characteristics, you could use something like 10 and 12,3 for the same amount of trades but drawdown was significantly more – in essence it meant the trades taken had reduced drawdown and removed drawdown to around only 1/4 risk max and mainly minimal with the code here, so essentially its entering on direction is improved greatly. Only 2 of the 7 trades drew down at all really. I may take a peak at this for longs as it goes in relation to drawdown in-trade, though the longs doing ok, I’ve added code on my longs to start at 0.5% risk and progress to 1% then 2% risk ongoing once the profits acrue sufficiently and doing that in 3 increments of 0.5%, 1% and 2% risk accordingly, that way the program will risk manage itself and I’ve put a quit level of 1% loss to review if failing. So the shorts here are not many, an average of a little over 1 a month, but only trading in 3 of the 6 months I can currently backtest :- oh how I yearn for that extra data that’s forthcoming!!
I’m tempted to stick it in the long code, but think due to the minimal amount of trades I’ll have to test this longer unless I can do for a couple of years, which may be possible this year some time, it won’t be going live short at any time soon due to my risk management practices.
On the basis of the code criteria for entry, the only way to modify further would change the code to a different program probably, though I am monitoring how the volume effects it.. but as I said probably do this more comprehensively once the data is available which should allow a 2 year backtest once it comes – on the 1 minute chart.. So if that proves to have good results I’ll probably stick it up live once twekaked and there’s more substantive data.
Forward testing is continuing but I think further refinement is now limited until data arrival – from my perspective anyway, but I’ll certainly rekindle it the minute I get the data. The longs are already live for me with my amended code.
Hope that helps
Shorts mods1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253// Main code : Makside 1 min test code timed shorts only modified by Philip Penny https://philtrading.uk//-------------------------------------------------------------------------Defparam cumulateorders = falsetd1 = 1 AND OpenDayOfWeek = 1 AND OpenTime >= 070000 AND OpenTime <= 205500 //Mondaytd2 = 1 AND OpenDayOfWeek = 2 AND OpenTime >= 070000 AND OpenTime <= 205500 //Tuesdaytd3 = 1 AND OpenDayOfWeek = 3 AND OpenTime >= 070000 AND OpenTime <= 205500 //Wednesdaytd4 = 1 AND OpenDayOfWeek = 4 AND OpenTime >= 070000 AND OpenTime <= 205500 //Thursdaytd5 = 1 AND OpenDayOfWeek = 5 AND OpenTime >= 070000 AND OpenTime <= 205500 //FridaytdCond = td1 OR td2 OR td3 OR td4 OR td5//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : CANDLE//-------------------------------------------------------------------------n = 1.33//timeframe(15 minute,updateonclose)//c160m = open > open[1] and close > close[1] and close > open//shortc160b = open < open[1] and close < close[1] and close < opentimeframe(1 minute,updateonclose)//c11m = open > open[1] and close > close[1]//c21m = abs(close-open) >= 16//c31m = abs(close[1]-open[1])//c41m = c31m > c21m//shortc11b = open < open[1] and close < close[1]c21b = abs(open-close) >= 5c31b = abs(open[1]-close[1])c41b = c31b < c21btimeframe(default)//c1def = open > open[1] and close > close[1]//c2def = abs(close-open) >= 1//shortc1defb = open < open[1] and close < close[1]c2defb = abs(open-close) >= 1//IF not longonmarket and c1def and c11m and c21m and c41m and c2def and c1def and c160m and Close crosses over Supertrend[12,3] and tdcond then//BUY N contracts at market//set stop ploss 300//ENDIF//shortIF not shortonmarket and c1defb and c11b and c21b and c41b and c2defb and c1defb and c160b and Close crosses under Supertrend[12,2] and tdcond thensellshort N contracts at marketset stop ploss 300ENDIFtp=28Set target pprofit tp1 user thanked author for this post.
09/06/2020 at 2:17 PM #143465oh #i made an error there in the code timeframe..
09/06/2020 at 2:29 PM #143472Looking at the code, surely there a few lines that (IMO) are preventing more profitable trades?
Do we really want C41m = 1 > 0 (or is it -1 for boolean logic??)?
1234//c11m = open > open[1] and close > close[1]//c21m = abs(close-open) >= 16//c31m = abs(close[1]-open[1])//c41m = c31m > c21mAlso substitute values for Close and Open for Longs and Shorts and you will see that we don’t need the abs(…)??
Using, for example, abs(close-open) >= 16 could derive from price action where Close -Open >= – / minus 16 and yet with abs( …) the absolute value of 16 ( – / minus ignored) would be used … is that what we want??
Just a few thoughts anyway.
Hope that make sense, wife calling me to go for a walk now! 🙂
09/06/2020 at 2:33 PM #143473That’s interesting.
So 1 minute all timeframes with same code improves the program, no 15 minutes timeframe improves results significantly on the 1 minuteprogram.
On the longs it basically trebled profits removing 15 mins whilst increasing trades and went to 1 stopout in 86 trades, so I’ll look at that again later..
On th eshorts it goes from 1 trade to 7.
That was with my trade amount management in mind, so more trades increased the profit more quickly, however program would have succeeded with the 1% risk tolerance for quit on th elongs with oly one stopout.
-
AuthorPosts
Find exclusive trading pro-tools on