Newbie type Questions & Answers
Forums › ProRealTime English forum › ProOrder support › Newbie type Questions & Answers
- This topic has 45 replies, 5 voices, and was last updated 4 years ago by tradetrader101.
-
-
05/07/2020 at 8:25 PM #130514
Also is there a way to stay out of a market only while it has a high spread. So basically a code or setting that says don’t enter the market unless the spread is 3 for instance?
Yes code to not open a trade at the times shown on attached
1 user thanked author for this post.
05/07/2020 at 8:27 PM #130516Is there a way to make bulk changes to strategies so for example categorising long and short strategies into two separate groups and giving them a weighting so like 60% of your strategies 60% have to be long and 40% short for example.
I may not understand what you are asking, but only way I can think of is you would need to keep track and code accordingly for Long or Short strategies.
05/07/2020 at 11:29 PM #130534Hi thanks again for taking the time to respond. I actually do run each back test individually and then I hit the little black x button on the graph to close them but sometimes it behaves like i’ve hit the 10 limit. An regarding pausing the strategies I just submitted the request. It’s a long shot but fingers crossed lol. That google doc sheet is extremely helpful, didn’t even know it existed. Much appreciated 🙂
I know this is a bit of a vague question but is the strategy I posted earlier a simple strategy or am I more on the complexed side? So would a typical strategy or would the majority of people on the forum be using far more complexed algorithms or simpler ones? An by simple I’m primarily thinking of the parameters.
I’ve had some good returns at points but do most people on here have volatility checks, momentum checks on top of check after check or do most people tend to keep thing simple? Just kind of wondering if there’s a typical way to do build quant strategies?
Also is there any type of mentorship programmes for people I could e-mail or get on skype calls with or coaching etc? An that’s not something I would mind paying for.
Also looking at a the code I posted earlier is there any improvements you would make to it or anything people usually add that it’s just missing? Like something to keep it out of a sideways trading market etc.
Also thanks for letting me know about the DAX and DJI but do people typically just trade that and other indexes during the U.K 9-4;30, German 9-4;30 and the U.S 9-4:30? Or do people kind of follow the sun coming up around the world? So set their algorithms to the Australian index and then the Korean one at midnight and then the Indian one at whatever time of the morning that would start so they’re always in a active market?
An if so then could you let e know which world marries are popular on for this because I tried Australian shares and the BRL/JPY currency pair last night and came back with 0 transactions which was strange because there was plenty in the back testing.
05/08/2020 at 9:12 AM #130556I hit the little black x button on the graph to close them but sometimes it behaves like i’ve hit the 10 limit.
Do you also close the results Tables??
05/08/2020 at 9:17 AM #130562a simple strategy or am I more on the complexed side?
I can understand the code so I would consider it simple! 🙂
Some of the strategies on here, I doubt the Author understands them easily a few weeks late!!?? 🙂
1 user thanked author for this post.
05/08/2020 at 9:22 AM #130563Also is there any type of mentorship programmes for people I could e-mail or get on skype calls with or coaching etc?
Nicolas, the website owner, has the video training and he also does fee paid programming.
Soon there may be folks offering mentorship via Nicolas ‘Market Place’.
The links are from the menu at the top of this page.
05/08/2020 at 9:50 AM #130569Or do people kind of follow the sun coming up around the world? So set their algorithms to the Australian index and then the Korean one at midnight and then the Indian one at whatever time of the morning that would start so they’re always in a active market?
Sounds kinda utopian.
In reality … most of us are still trying to work up a strategy that makes consistent profits and therefore would allow us to sleep soundly while our money is going up and down on the Nikkei 225! 🙂
I have not found one and I have over 4,000 .itf ‘s on my PC … this will give you an idea as to how difficult it is!
Strategies work for a while then start losing and so you lose confidence in them all … that losing streak may start while you are asleep! 🙂
I personally prefer all my money to be back in me pot before I try and go to sleep!
Anyway you can trade markets ‘out of hours’ … e.g, the DJI is a 24 hour market.
1 user thanked author for this post.
05/08/2020 at 10:14 AM #130571Also looking at a the code I posted earlier is there any improvements you would make to it or anything people usually add that it’s just missing? Like something to keep it out of a sideways trading market etc.
To get folks interested enough to make improvements you would need to post a strategy on a separate Topic and post results that tempt them to spend their time.
If you ask a specific coding question then the moderators and / or a few others will help. You need to ask a specific question under a separate Topic and give your Topic a meaningful title … so others members can find the information and benefit etc.
What market(s) and timeframe is your strategy coded for?
I changed all Timeframes to default and flashed it over DJI TF’s from 10 sec to 4 hours and it does by far the best on 1 hour … results attached.
EDIT / PS
But you need to temper those results by looking at the Chart … if you had done Buy and Hold … does your strategy beat buy and hold??
I’d say maybe yes as during the recent 10k points shake out it lost only 1.2k, but overall the DJI is up about 8k points from the start of the attached chart and your strategy is up 9.2K points.
Problem for me would have been … that £1.8K drawdown / loss early on would have been out of my pocket … as the strategy had not made any profit at that point.
A drawdown is far more bearable if it is out of profit the strategy has made itself??
1 user thanked author for this post.
05/08/2020 at 12:23 PM #130607Thanks for the link to spread time table. It never even occurred to me that one would exist lol
Yes I do close the results tables. Sometimes I have to close every table and chart accept for the one I’m looking at a an dI can’t run a back test until I click the black x on the last strategy I run. Maybe there’s is some type of cache that takes time to be cleared or updates because it only happens after I’ve ran several back tests before and then deleted them.
Loool “I doubt the Author understands them easily a few weeks late!!?? 🙂”. That make me feel so much better. Some of the codes looked really complicated to me and I just assumed everyone understood them. So at least now I have some perspective 🙂
I’ve watched the free video training but I’ll definitely look into the fee paid programming and hopefully I can find someone offering mentorship. Thanks for the links.
Do most of your strategies go long and short inside one strategy? or do you have your long only strategies and short only strategies?
I seem to have created some fairly consistent strategies but I’m not sure if long and short strategies in general would experience more drawdown because you are making more trades or less because they should be more market neutral?
Also I’d suspect that long and short combined strategies are usually the most profitable because they make more trades or are they just less profitable because it’s harder to create a consistent long and short strategy?
Yep a utopia sounds nice. I have a friend who works managing a section fo a quant devision and he suggested the 24 hour strategy. It sounds like I’d have a lot of work cut for me.
I read this article https://www.prorealcode.com/blog/learning/how-to-improve-a-strategy-with-simulated-trades-1/ and this article https://www.prorealcode.com/blog/trading-strategy-profit-curve/
In the comments section it sounds like there was some issues with code in the comments section but it was years ago so maybe it’s been resolved but in theory wouldn’t it be easy to sleep if the Algo went into only simulated trades once the trades became unprofitable and then started back up only once the simulated trades were profitable?
That way you should wake up a profit or only a minimal loss. Do you think I could pay to have a cross between these techniques coded for me? So then I could trade overnight easier.
Well done coding 4,000 is an achievement in itself. I’ve done around 40 so far. 20 of them was from last year but with a few tweaks still work fine at the moment. I focus a lot on out of sample testing. An I’ve been using the optimisation engine on quantreex which seems to work well.
Is there any indicators that really seems to make a difference for you that is a recurring theme in the 4,000? Personally Aroon up/down seems to be pivotal and RSI overbought/oversold level cut offs really seem to help quite a few of my strategies over time.
With the strategies I coded for it’s displayed in the code so look for “TIMEFRAME 15 minutes” AND “TIMEFRAME 1 minute”. So some things have to happen on a 15 minute chart simultaneously with other things happening on a 1 minutes chart.
It’s been pretty consistent so far at least relative to the markets. So I’ve been chopping and changing a lot with the changes in market conditions lately but on average I run each strategy on 4-6 different instruments at once and all with an equal amount of pips on each one.
This is an effort to just diversify the portfolio and minimise the drawdown. Plus my friend said that’s how they programme the algorithms where he works. I’ve tried maybe 15-20 different instruments and settled on the most consistent 4-7 as France 40, FTSE 100, German DAX (Excluding overnight), EU Stocks 50, AUD/CHF, NZD/JPY and AUD/CHF
When you say “flashed it over DJI TF’s from 10 sec to 4 hours” is there a code to do that simultaneously or do you do that one by one?
Also yes I noticed during back testing DJI was the 4th best performer all month but in Pro Order you can’t do less then 1/pip so with diversifying with 4-6 instruments at all times the DJI has been too expensive to try so far.
I know you can use mini lots with manual trading but pro order does seem to go under 1/pip Is there any way around that?
Also with the drawdown I want to set a daily stop loss do you know how to do that? Some days the market conditions just don’t suit a strategy/ instrument pairing so just pausing it at a maximum drawdown and then starting back up the next day and repeating until the market conditions become more favourable will mitigate drawdown plus with 4-6 instruments at all times drawdown should be minimised already.
I need to code some of short sell strategies over from quantreex to make everything market nuetral as well.
That’s a really interesting test how long do you check the buy and hold period for? So what would’ve happened if you held a month or a fortnight or a day etc?
05/09/2020 at 10:49 AM #130711it only happens after I’ve ran several back tests before and then deleted them.
I find this also, it’s like a process is hanging … that’s why I close the Platform after a few heavy sessions and log back in … only take 30 seconds tops and saves loads issues and basktests seems faster for a while until rinse and repeat! 🙂
Do most of your strategies go long and short inside one strategy?
Yes, but it can be annoying as when I judge that on a losing trade that price is likely to reverse as it is at the top / bottom of a pullback and then bang the position reverses and so I have lost the chance to make the loss up and also the new trade is likely to lose also!
I guess above is a case for not having long reverse into short strategies, but some of my most profitable over long term are just these types! I guess because they are in the market 99% of the time so they only have to be correct 60% of the time and it can be a big winner!!
05/09/2020 at 11:14 AM #130717Algo went into only simulated trades once the trades became unprofitable and then started back up only once the simulated trades were profitable?
Trouble is that profitable trade, made during simulated trades, might be the biggest winner for weeks, but we missed it due to being in simulated trades mode!
Well worth more investigation though … please let us know your conclusions?
Well done coding 4,000 is an achievement in itself.
I counted (using folder properties! 🙂 ) after I said 4000 and it is actually 4877, but they are far from all my original work!
Loads off this website and I may then spawn 3 or 4 versions with various tweaks etc and so the number of files grow and grow!! 🙂
Also I never delete anything as I may throw the baby out with the bath water.
05/09/2020 at 11:44 AM #130723Hi @tradetrader101 – had a quick look at your code and my first thought was that you could do better than using the basic trailing stop. This one by Nicolas is v good and has a built in break even function:
1234567891011121314151617181920212223242526272829303132333435363738//trailing stop functiontrailingstart = tst //trailing will start @trailinstart points profittrailingstep = st //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFFor a % version of the same, change the first 2 lines to
123456trailingPercent = tststepPercent = stif onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailingstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stoplossendifThis one by Roberto is extremely clever and def worth trying, may require adjusting the initial values (BasePercent, TrailStart, StepSize, PerCentInc)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980IF Not OnMarket THEN//// when NOT OnMarket reset values to default values//TrailStart = 30 //30 Start trailing profits from this pointBasePerCent = 0.200 //20.0% Profit percentage to keep when setting BerakEvenStepSize = 10 //10 Pip chunks to increase PercentagePerCentInc = 0.100 //10.0% PerCent increment after each StepSize chunkRoundTO = -0.5 //-0.5 rounds always to Lower integer, +0.4 rounds always to Higher integer, 0 defaults PRT behaviourPriceDistance = 7 * pipsize //7 minimun distance from current pricey1 = 0 //reset to 0y2 = 0 //reset to 0ProfitPerCent = BasePerCent //reset to desired default valueELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONG positions//// compute the value of the Percentage of profits, if any, to lock in for LONG trades//x1 = (close - tradeprice) / pipsize //convert price to pipsIF x1 >= TrailStart THEN // go ahead only if N+ pipsDiff1 = abs(TrailStart - x1) //difference from current profit and TrailStartChunks1 = max(0,round((Diff1 / StepSize) + RoundTO)) //number of STEPSIZE chunksProfitPerCent = BasePerCent + (BasePerCent * (Chunks1 * PerCentInc)) //compute new size of ProfitPerCentProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent)) //make sure ProfitPerCent doess not exceed 100%y1 = max(x1 * ProfitPerCent, y1) //y1 = % of max profitENDIFELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN //SHORT positions//// compute the value of the Percentage of profits, if any, to lock in for SHORT trades//x2 = (tradeprice - close) / pipsize //convert price to pipsIF x2 >= TrailStart THEN // go ahead only if N+ pipsDiff2 = abs(TrailStart - x2) //difference from current profit and TrailStartChunks2 = max(0,round((Diff2 / StepSize) + RoundTO)) //number of STEPSIZE chunksProfitPerCent = BasePerCent + (BasePerCent * (Chunks2 * PerCentInc)) //compute new size of ProfitPerCentProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent)) //make sure ProfitPerCent doess not exceed 100%y2 = max(x2 * ProfitPerCent, y2) //y2 = % of max profitENDIFENDIFIF y1 THEN //Place pending STOP order when y1 > 0 (LONG positions)SellPrice = Tradeprice + (y1 * pipsize) //convert pips to price//// check the minimun distance between ExitPrice and current price//IF abs(close - SellPrice) > PriceDistance THEN//// place either a LIMIT or STOP pending order according to current price positioning//IF close >= SellPrice THENSELL AT SellPrice STOPELSESELL AT SellPrice LIMITENDIFELSE////sell AT MARKET when EXITPRICE does not meet the broker's minimun distance from current price//SELL AT MarketENDIFENDIFIF y2 THEN //Place pending STOP order when y2 > 0 (SHORT positions)ExitPrice = Tradeprice - (y2 * pipsize) //convert pips to price//// check the minimun distance between ExitPrice and current price//IF abs(close - ExitPrice) > PriceDistance THEN//// place either a LIMIT or STOP pending order according to current price positioning//IF close <= ExitPrice THENEXITSHORT AT ExitPrice STOPELSEEXITSHORT AT ExitPrice LIMITENDIFELSE////ExitShort AT MARKET when EXITPRICE does not meet the broker's minimun distance from current price//EXITSHORT AT MarketENDIFENDIF1 user thanked author for this post.
05/09/2020 at 12:54 PM #130736I’ve been using the optimisation engine on quantreex which seems to work well.
Do strategies created on quantreex work on PRT??
I run each strategy on 4-6 different instruments at once and all with an equal amount of pips on each one.
When you say run do you mean backtest or forward test?
What you mean equal amount of pips? Pips are movement in price, so 4 strategies on 4 instruments cant make the same pips / profit??
When you say “flashed it over DJI TF’s from 10 sec to 4 hours” is there a code to do that simultaneously or do you do that one by one?
Also yes I noticed during back testing DJI was the 4th best performer all month but in Pro Order you can’t do less then 1/pip so with diversifying with 4-6 instruments at all times the DJI has been too expensive to try so far.
I know you can use mini lots with manual trading but pro order does seem to go under 1/pip Is there any way around that?
Flashed it over (imperfect term) … yeah backtest each TF manually … no code or easy way but its only 2 clicks of the mouse anyway. Your code backtested in seconds as I recall (?) hence why I said flashed I guess! 🙂
Yes we can use £0.2 per point / pip on UK spreadbet on DJI for example.
05/09/2020 at 1:03 PM #130739That’s a really interesting test how long do you check the buy and hold period for? So what would’ve happened if you held a month or a fortnight or a day etc?
Buy and hold for as long as the Chart went back … its just a case of lining up the horizontal cross hair at the start and reading price level then doing same at end of chart period and taking lower price from bigger … takes seconds.
then starting back up the next day
I stop all my Auto-Systems every night and start up them up again when I am eating my breakfast!! 🙂
I have yet to find a single System that consistently takes trades in what I consider to be the correct / logical places.
I hope you are doing all your testing / trials on a Demo Account for many months or at least 50 trades, preferable more?
PS
Are you using free Quantreex or are paying the min £75 per month??
05/09/2020 at 1:41 PM #130747For buy and hold you can also add this indicator that Nicolas wrote to the equity chart.
123456789101112131415161718//capital = 10000mylot = 1//startdate = 19851125once firstclose = 0if date>=startdate thenif firstclose = 0 then//save the current close once when the comparison startfirstclose = closeendif//calculate buy and hold with pointvalue and pointsize of the current sharebuyandhold = capital+(((((close-firstclose)*pointvalue)*mylot)/pointsize)*stake)else//if the displayed date is previous from the startdate, let's draw the buy and hold curve as the capitalbuyandhold = capitalendifRETURN buyandhold coloured(255,128,0)2 users thanked author for this post.
-
AuthorPosts