CODING TRADING AUTOMATIONS | July 31 | Michele Rossi — Transcript
Full transcript
- 0:02Code code is wrong.
- 0:16[music]
- 0:56What is going on guys? Welcome back.
- 1:01Test test test 1212. Here we are again.
- 1:04Welcome back beautiful people. Before we
- 1:06begin, I want to thank Thunderro for
- 1:09making this educational series possible.
- 1:11Thunderpro is in my opinion one of the
- 1:14best prop firms for traders who want to
- 1:16use algorithm trading. If you want to
- 1:19check it out, you will find the link in
- 1:21the description or on screen. Uh you can
- 1:24also use the code live to receive the
- 1:26best discount currently available. Now a
- 1:30very quick recap. In the previous video,
- 1:33we started with an idea, the opening
- 1:36range breakout. We transformed that idea
- 1:40into precise trading rules. We gave the
- 1:44specification to codeex. We generated a
- 1:46pine script strategy. We installed it on
- 1:49trading view. We fixed couple of errors
- 1:53very quickly and we created the first
- 1:56working version of our orb bot. It is
- 2:01called Orbinder Pro. Right.
- 2:05Um, if you missed the lesson, you can
- 2:07find it up here or here or in the link
- 2:10down below on YouTube. So, today we are
- 2:14going to take the first working version
- 2:17and improve it. But we need to be
- 2:20careful. There is a major difference
- 2:23between optimization
- 2:25and curve fitting. Optimization means
- 2:30testing a small number of reasonable
- 2:34alternatives to understand how the
- 2:37strategy behaves.
- 2:39Curve fitting means repeatedly changing
- 2:44parameters until the historical equity
- 2:48curve looks perfect. Today I will show
- 2:51you the different tests I perform to
- 2:55reach this result.
- 2:57Then we will inspect the settings and
- 3:00the results you can see right here.
- 3:02Okay. And then we will inspect the
- 3:06settings to simulate more realistic
- 3:08market conditions. Export the trades and
- 3:11use codeex shad GPT cla I will use
- 3:15codeex. You can use whatever you wish to
- 3:17validate the strategy. So by the end of
- 3:20the lesson we will not simply have a
- 3:22profitable back test. we will have a
- 3:25much clearer idea of whether the
- 3:29strategy deserves to move to the next
- 3:32stage. Right? So once again, we're going
- 3:36to use AI. It's free. It's available for
- 3:40everyone. Is it the best tool that you
- 3:44can use? Of course not. There are
- 3:47professional tools to do this in a much
- 3:50better profound precise detailed way and
- 3:54it will gives us also more precise
- 3:57results. But
- 4:00I mean it's free. You can use it. It's
- 4:03going to give you an overall overview.
- 4:06It it is going to teach you a clear
- 4:08process. It will guide you through uh
- 4:12how to create a bot, back test,
- 4:14optimization, validation, and deploy.
- 4:17So, we're going to use this.
- 4:20Um I'm now showing you the results I
- 4:24obtained
- 4:25um on the E mining NASDAQ futures using
- 4:30a five minute chart. As you can see
- 4:32right here, the test period show here
- 4:36runs from April 19 to July 31st. So I
- 4:40tested the last three months. The better
- 4:43things to do is go even way back in time
- 4:46like testing at 365 days or even more.
- 4:51As you can see, the strategy is still
- 4:53profitable even though in the beginning
- 4:55give us gives us a a bit of a draw down
- 4:59and it stays in the red for quite a
- 5:01while. So this might suggest is
- 5:06a regime part which is giving us this
- 5:09beautiful uh curve in the last 90 days
- 5:13but we're going to use that as for
- 5:15educational purposes only. Okay. So the
- 5:18strategy produced a total of 17,152
- 5:23which is a 17%
- 5:2617% with a maximum draw down of 9.15
- 5:32it gives us a 61.66
- 5:36um win rate with a profit factor of 1.3.
- 5:42Right? So the equity curve finishes at a
- 5:47new high and the last section is
- 5:50particularly strong. Do I like the
- 5:53results? Yes, I like it as a starting
- 5:56point. It is profitable after adding
- 6:00execution costs. It has a reasonable
- 6:03number of trades for an initial
- 6:06investigation and the equity curve does
- 6:09not depend on one single trade. But I'm
- 6:12not saying the strategy is ready. A
- 6:14profit factor of 1.3 is positive, but it
- 6:17does not gives us an enormous safety
- 6:20margin. The maximum draw down is also
- 6:23important for a prop. We made
- 6:26approximately 17% with the um
- 6:32with the one point the strategy was down
- 6:35across approximately 9%. That gives us a
- 6:39return to draw down ratio of around two.
- 6:42That is interesting. But a 9% draw down
- 6:44can already be too large for many prop
- 6:46firm accounts, especially when the
- 6:48strategy is risking 1% of equity per
- 6:51trade. But hey, you can reduce it to 0.5
- 6:55just as an idea. So
- 6:58this uh scenario is not the conclusion.
- 7:02it is the candidate that we are going to
- 7:05investigate again for educational
- 7:08purposes. I I I would go and back test
- 7:11even more. I would try to find better
- 7:13settings etc etc but
- 7:16we have a restricted amount of time to
- 7:18be live with you guys today. So we're
- 7:20going to take this last three months I
- 7:22went through just before the call I
- 7:24found this last three month. It's okay.
- 7:26We can back test it. We can optimize it.
- 7:28So let's open the strategy inputs right
- 7:31here. And these are the settings that
- 7:35produced the results. So from here to
- 7:39here, let me let me get my pen.
- 7:47Where is it? Where is it? Where is it?
- 7:49Where is it? Where is it? Where is it?
- 7:51Screen brush.
- 7:53Screen brush. Show screen brush. So what
- 7:56you want to look is from here to here,
- 7:59right? Um
- 8:03the first trade risk-to-reward is set to
- 8:060.8. The reverse trade option is
- 8:10enabled. The risk-to-reward ratio for
- 8:12the reverse trade is set to 1.0. The
- 8:15strategy is allowed to trade in both
- 8:18direction, long and short. And the
- 8:21active days are Monday, Tuesday,
- 8:22Wednesday, and Friday. Thursday is
- 8:25disabled. So, the opening range candle
- 8:28begins at 10:30.
- 8:31Um,
- 8:33be careful with the time zone. The
- 8:35numbers shown in the input.
- 8:39Uh,
- 8:42I mean, we got to be careful. We got to
- 8:44be careful with this opening time and
- 8:48and opening range session. Okay. I I was
- 8:52forgotten. I set this on Asia time zone,
- 8:55right? So, always be careful to find the
- 8:58right time align with the time zone,
- 9:01right? Um
- 9:04because a strategy can produce of course
- 9:07a very different
- 9:10results if you change the time zone.
- 9:12It's 10:30 in Italy. It's 10:30 in Asia.
- 9:16It's 10:30 in Spain. Okay. Um
- 9:20so the chart is the last final visual
- 9:23check. Now let's understand how I
- 9:26arrived to at these values. I did not
- 9:29ask codeex to test thousands of random
- 9:32combinations. So I divided the problem
- 9:35into small experiments.
- 9:39The main variable I tested
- 9:42was
- 9:45let me give a little bit more of room
- 9:47right here. Okay. So, the main variables
- 9:51were the risk to reward.
- 9:58There it goes.
- 10:01Um,
- 10:03of the first breakout
- 10:05uh whether or not allow
- 10:09reverse trade. So, that means we have
- 10:13our range right here. We got a breakout.
- 10:16We take a long position buy. We got a
- 10:19reversal and a breakdown. And we take
- 10:22another position, a sell like you can
- 10:26see it happened right here. First
- 10:29breakout, sell, stop-loss, second
- 10:31breakout, take profit, right? Um, so
- 10:36what I tested, what else I tested? I
- 10:39tested uh of course the risk to reward
- 10:45into the reverse trade. Uh I tested long
- 10:50only
- 10:52short only and both directions
- 10:57and I tested the day of the week. So by
- 11:04picking which day to exclude like for
- 11:08example I saw that Thursday was the one
- 11:12day where the strategy was performing
- 11:14the worst. So in this period of time so
- 11:17I decided it for this um educational
- 11:21content to remove it. But we can do it.
- 11:24It needs to have a reason. Maybe the
- 11:26strategy performed not so good when we
- 11:29have major news releases such as we have
- 11:33job data on Thursday might be the case.
- 11:36I don't know. So I removed it but it is
- 11:38logical. So every time I changed one
- 11:41concept I uh recorded the results. So I
- 11:47screenshot it. I screenshotted the
- 11:49settings. I created a a folder on my
- 11:52desktop or you can simply sign up on a
- 11:55piece of paper. Um this is very
- 11:59important. If we change five inputs
- 12:01together, we may improve the results but
- 12:03we will not know which change was
- 12:06responsible for that. So um before we
- 12:11running the tests, I will ask codeex
- 12:15to create a simple optimization log.
- 12:20Okay,
- 12:23then I will use this prompt. Let me open
- 12:26up codeex.
- 12:28This is last week uh
- 12:32chat where we coded the strategy.
- 12:35I have the prompt already done. So, let
- 12:38me pick it up. I don't want to waste
- 12:40time.
- 12:46Okay, this is it. And I'm going to read
- 12:49it for you guys.
- 13:09There it goes.
- 13:11So the Cody the the the prompt is I'm
- 13:14developing an opening range breakout
- 13:16strategy in Trading View. I have
- 13:18attached a screenshot of the candidate
- 13:21strategy results, a screenshot of the
- 13:22strategy inputs, and the screenshot of
- 13:24the trading view strategy properties.
- 13:27Read the visible settings and create a
- 13:29optimization experiment log. Use the
- 13:32screenshot only to record the visible
- 13:34configuration. Do not calculate missing
- 13:36statistics from the image and do not
- 13:38invent values that are not visible. The
- 13:41candidate configuration currently uses
- 13:44trade to risk to reward 0.8. So right
- 13:46here I have all the settings that are
- 13:49being used right now and I want you to
- 13:51create a CSV which is a text file named
- 13:55orb optimization log CSV with this
- 13:58column test ID test purpose the range
- 14:01instrument time frame first trade risk
- 14:04reward reverse trade enable blah blah
- 14:06blah all the things that we want to test
- 14:09and the visible candidate results as the
- 14:11first row mark any unavailable values as
- 14:15not provided. Do not recommend a final
- 14:19uh configuration
- 14:22yet. So this is the this is not useful,
- 14:27right? So what are we going to do? We're
- 14:29going to screenshot this
- 14:37and put it into codeex.
- 14:41We're going to scroll down.
- 14:44Screenshot this,
- 14:52put it into codeex.
- 14:56We're going to go to the
- 14:59returns,
- 15:01screenshot this,
- 15:06put it into codeex.
- 15:09And we can also give
- 15:13the list of the trades. We can download
- 15:16it. A CSV file going to be downloaded
- 15:19and we can put it into our
- 15:27right here. Codeex. We can screenshot
- 15:31the settings.
- 15:40put it into codeex
- 15:43and we're going to screenshot also the
- 15:45properties. This is a very important
- 15:48part because right here we're going to
- 15:50talk about it a little bit later. I gave
- 15:54um trading view stats and let it run. I
- 15:59gave trading view strats um initial
- 16:03capital default order sides bar
- 16:06detailization
- 16:07high 40 ticks per bar. As I said this is
- 16:10not full depth data.
- 16:13Okay. So this is a
- 16:18something that we can use as a reference
- 16:20as a starting point. These are not real
- 16:24full indepth tick data millisecond per
- 16:28millisecond. Okay, we're going to add a
- 16:30little bit of commission. We're going to
- 16:32add a little bit of slipage couple of
- 16:34ticks. We're going to add if we're using
- 16:36limit orders an extra layer of one tick
- 16:40beyond of sleeps and order execution
- 16:42delay. If we're using uh market orders
- 16:45is going to be delayed by one tick. So
- 16:47we're trying to simulate the the the at
- 16:50the best possible uh not best possible
- 16:54but worst possible conditions how the
- 16:57strategy would really execute on live
- 17:00market conditions. Right?
- 17:04Stop.
- 17:13So I'm using the spreadsheet skill
- 17:15because the requested deletable is the
- 17:17instructor CBS. I record only values
- 17:20explicitly visible blah blah blah. The
- 17:21spreadsheet instruction should point to
- 17:23local reference file skill fer and
- 17:25correcting the path. So codex is doing
- 17:28its own thing.
- 17:30Um what is going to give us is going to
- 17:33give us a good path to
- 17:38um
- 17:41to do what to open the settings and it
- 17:45gives us suggestion on how to
- 17:50change these parameters in a intelligent
- 17:53way. So to have multiple
- 17:57um results
- 17:59then we're going to give it to Codex
- 18:02again and he's going to tell us look
- 18:05this is what I believe on a mathematical
- 18:10and statistical
- 18:12um reference
- 18:15the best possible results that I
- 18:19believe. Okay. So, it's going to compare
- 18:21the net profit, the draw down, the
- 18:23profit factor, the win rate, the average
- 18:27um trade, and the trade count. Okay. Um
- 18:33I don't know how long it's going to
- 18:34take. Okay, good. Let's open it.
- 18:39Let's take a look.
- 18:43Okay, gives us is in a very bad
- 18:47situation to read. Let's try this way
- 18:54now. Way better.
- 18:57Okay. It's a It's a very long It's a
- 18:59very long thing. It's I I believe it's
- 19:01not created properly.
- 19:05Uh
- 19:10again, I I'm going to say to do it again
- 19:13and be sure to have the full list. Okay.
- 19:19It happens. So, but what is what it's
- 19:22going to give us is a list of
- 19:26do this this and that. Try these
- 19:29parameters. So, what you're going to do,
- 19:30you're going to change those parameters
- 19:33and you're going to write down and
- 19:36collect all the data, all the
- 19:38screenshot, all the results as I said I
- 19:40did before. Okay. So with these results
- 19:44you are going to compare all all the the
- 19:49results the draw down the profit factor
- 19:51etc. But let's say you have a set of 10
- 19:54different one two three four five six
- 20:00etc etc. You have a set of 10 different
- 20:04um [clears throat]
- 20:05outcomes.
- 20:07Do not automatically select the value
- 20:09with the highest net profit.
- 20:12Try to identify whether there is a
- 20:15stable region across
- 20:18neighboring values. Okay. Which values
- 20:22produce excessive draw down? Whether the
- 20:27apparent improvement
- 20:30comes mainly from a higher win rate or a
- 20:34larger average winners. It is very
- 20:39simple to spot because you have the full
- 20:41list of trades. But with this particular
- 20:43strategy is not going to happen because
- 20:46again it's a very fixed riskreward,
- 20:49right? Um
- 20:52whether any results appear isolated and
- 20:57potentially overfeeded.
- 21:00Okay. Um, so you're going to
- 21:07get these
- 21:10values that Codex is going to give you
- 21:14and give it back to him and say, "Look,
- 21:17I picked this one and this one and this
- 21:21one for this particular reason."
- 21:25Okay. What do you believe is the one
- 21:28that is the best for my strategy?
- 21:32Okay. Um let's say my candidate
- 21:35configuration the first trade target is
- 21:370.8R.
- 21:39That means that if the initial stop
- 21:41distance represents one unit of risk,
- 21:44the target is 0.8 times that distance.
- 21:46That target is smaller than the stop.
- 21:49But that is not automatically
- 21:52uh means that is a problem. So the
- 21:55complete results depend on the win rate,
- 21:58the reverse trade, the transaction costs
- 22:01and the combined expectancy of both
- 22:05entry type. Right? So um when we review
- 22:12all of these,
- 22:14the next test you want to do is um the
- 22:21the candidate settings. So let's let's
- 22:24let's
- 22:27pick these settings. So I just explained
- 22:30you
- 22:32how I get to these results, right? So I
- 22:34got to these results. I use a codeex in
- 22:36the way I showed you. Now we have these
- 22:38results.
- 22:42Given these results,
- 22:45right?
- 22:48I save this condition.
- 22:52Right? So, we're going to go to
- 22:57the cost stress test.
- 23:01So, I do not want to use only one
- 23:05execution assumption.
- 23:08So, I will repeat the test under
- 23:11different cost scenarios,
- 23:14right? And we're going to have let's say
- 23:17four four scenarios. One which is a
- 23:24um
- 23:26[music]
- 23:29optimistic
- 23:32right.
- 23:34Scenario B
- 23:37baseline
- 23:40right? Scenario C is going to be a
- 23:45conservative
- 23:49and scenario scenario four which is
- 23:51scenario B
- 23:55is a stress condition right let's say
- 23:58for scenario H A we have commission 0.5
- 24:02per contract slipage one tick for the
- 24:05baseline still 025 per contract two
- 24:08ticks of delay one tick For the delay,
- 24:12one tick limit verification. For the
- 24:14conservative, we're going to even raise
- 24:17the commission. We can do it three
- 24:19ticks. One tick, one tick. And for the
- 24:23stress, we're going to give $1 per
- 24:25contract, which is unreasonable, but
- 24:27we're going to do it again anyway. Four
- 24:30ticks of sleepage and more conservative
- 24:32field assumptions. Okay. And the purpose
- 24:36of this test is not to predict the exact
- 24:39cost of every future order. The purpose
- 24:43is to determine whether a small
- 24:46execution difference destroys the
- 24:49strategy.
- 24:51If the strategy
- 24:53is profitable only with perfect fields,
- 24:58again it is what you find into the
- 25:01properties.
- 25:03um it is not ready for live deployment.
- 25:06Right? So, we're going to export all the
- 25:11evidence and we're going to start to um
- 25:18to give um to sorry to start with um
- 25:23with this list of candidates, right? The
- 25:27list of candidates. This is our
- 25:29baseline, right? We have all of these
- 25:32trades. We downloaded all of these and
- 25:37what we're going to do is doing an in
- 25:40sample and out of sample validation. Let
- 25:43me write it down.
- 25:46So the next step
- 25:48is in sample
- 25:52and out of sample validation.
- 26:01Okay. Right. Um
- 26:06so we must now separate optimization
- 26:09data from validation data. The period
- 26:14used to select the 0.8R
- 26:17enable the reverse trade and remove
- 26:19Thursday's development data. This is it.
- 26:22We cannot use the same period as
- 26:25independent proof that those settings
- 26:27work. For a proper chronological test, I
- 26:30will define an earlier period of for
- 26:34optimization and the later untouched
- 26:37period for validation. So the later
- 26:39period must retain remain untouched
- 26:43until the candidate settings are fixed.
- 26:46So I'm I'm not going to reoptimize the
- 26:49strategy after seeing the validation
- 26:52results. So here's the prompt.
- 26:56Let me copy and paste because I prepared
- 26:58it in advance of course or it's going to
- 27:00take a long time.
- 27:24And we're going to give it the codeex.
- 27:36[music]
- 27:43Right. So I copied and paste. Oh, sorry.
- 27:46You're you're not seeing it. I copied
- 27:47and pasted it everything right here. So
- 27:51it is uh we must now separate
- 27:53optimization data from validation data.
- 27:57The period used to select 0.8 are enable
- 28:00the reverse shade and remove Thursday's
- 28:02development data. We cannot use the same
- 28:05period as independent proof that those
- 28:08settings work for a proper chronological
- 28:10test that will define an early period of
- 28:13optimization and the later untouched
- 28:16period for validation. Right. uh audit
- 28:19the file and confirm chronological
- 28:22separation, matching strategy
- 28:24configuration, matching instrument and
- 28:26time frame, matching execution customs
- 28:29and and assumptions. Compare the two
- 28:32periods using number of trades,
- 28:34expectancy, profit factor, win rate,
- 28:36average win, average loss, maximum draw
- 28:39down, longest losing streak, long versus
- 28:42short result, first versus reverse trade
- 28:46results, and return to drawdown ratio.
- 28:48Because the sample have different
- 28:52lengths, focus on per trade and
- 28:55percentage matrix rather than total
- 28:59profit alone. Identify which behaviors
- 29:02remain stable and which deteriorated
- 29:05materially uh is not working. Do not
- 29:08optimize the out of sample period and
- 29:12save the results as orb out of sample
- 29:15validation.
- 29:19Okay, we can have two scenarios. We can
- 29:22have a weaker out of sample results or a
- 29:27good out of sample results. A weaker out
- 29:30of sample results does not automatically
- 29:33mean failure.
- 29:35Some deterioration is normal. But if the
- 29:39strategy moves from positive expectancy
- 29:42to a clear and persistence persistent
- 29:45negative expectancy, the optimization
- 29:49probably captured noise. Right?
- 29:53Let's let it run. What we're going to do
- 29:56next? Next, we're going to do a walk
- 30:00forward test. So, a single in sample and
- 30:04out of sample split can still be uh
- 30:07influenced by the selected dates, right?
- 30:11So, we can perform a workforward test.
- 30:16For example, we can optimize on six
- 30:19month, we can test on the following two
- 30:21months. Uh we can move the window
- 30:24forward and repeat. Right? Let me say
- 30:28that again. This is very important. Let
- 30:30let me write it down. Um,
- 30:34optimize
- 30:37on six months,
- 30:40right?
- 30:42Sorry, months.
- 30:46One. Uh, we're going to test on the
- 30:48following month.
- 30:51[music]
- 30:54Let's say the following
- 30:58two months.
- 31:02We're going to move the window
- 31:07[music]
- 31:08forward
- 31:09and we're going to repeat,
- 31:13right?
- 31:15The strategy must always be developed
- 31:19using past data and tested using later
- 31:23data and codeex chat GPT uh Gemini
- 31:28whatever uh clo can help organize
- 31:33results but trading view must generate
- 31:36the trades for each window.
- 31:39Okay, is that clear? you have any
- 31:41question
- 31:49right? Yes. Yes. That that is a good
- 31:52question. Um
- 31:56these are
- 31:59the the candidate settings. So our
- 32:02candidate uses 0.8R for the first trade
- 32:05and one R for the reverse trade.
- 32:09I tested and you have to do so. So I'm
- 32:11telling you to test neighboring values
- 32:15for example first trade 0.6 0.81 and 1.2
- 32:19reverse trade 0.81 and 1.2 I've already
- 32:23done that and already gave that to
- 32:26codeex otherwise he cannot produce what
- 32:29he's doing right now but it it take
- 32:32quite a bit of time and we cannot stay
- 32:34here all day long. So I prepared some
- 32:36stuff before and
- 32:39in this way we're going to have
- 32:43and use
- 32:46a small parameter matrix let's say. So
- 32:50we're not searching for a perfect
- 32:52combination. We are checking whether the
- 32:54candidate sits inside a stable region.
- 32:59Right?
- 33:01Okay,
- 33:05let's see what point we're at.
- 33:08Beautiful.
- 33:10Okay, let's see.
- 33:14Validation design. The experiment.
- 33:22The experiment user chronological load
- 33:24out in sample and out of sample
- 33:27configuration audit for this educational
- 33:29example. board export assumed to contain
- 33:31the following identical configuration 5
- 33:33minutes 5 minutes 1030 1030 100% of
- 33:37equities so it gives us a lot of data
- 33:42136 in sample 68 out of sample
- 33:46uh winning trades 8240 5428 60% win rate
- 33:5158%
- 33:53average win 1 average win 925
- 33:58and we got of
- 33:59different very different results even if
- 34:04still positive 33% and 5.64%
- 34:08that's a huge difference but at the same
- 34:11time maximum draw down nine maximum draw
- 34:13down 6.4 four, longest losing streak,
- 34:17five trades. Longest
- 34:20losing streak, four trades. And we have
- 34:23all the results that we talked about,
- 34:26right? So, we have our in sample and out
- 34:30of sample validation.
- 34:33Um,
- 34:36the next the next thing that we have to
- 34:40do is with this file right here. Yeah.
- 34:44still with the same file. Uh we're going
- 34:47to give it to Codex and ask him to run a
- 34:54Monte Carlo test. Right.
- 35:00Let's give it a Monte Carlo test.
- 35:07So perform random reshuffleling of the
- 35:12existing trades without replacement.
- 35:15Bootstrap resampling with replacement
- 35:18block bootstrap resampling of
- 35:21consecutive trades using several
- 35:23reasonable block sizes to preserve some
- 35:27short-term dependence. Use the fixed
- 35:30random C2 to so the analysis is repro
- 35:34reproducible
- 35:36for each method. Calculate the
- 35:38distribution of final profit, maximum
- 35:40draw down, longest losing streak,
- 35:42minimum equity, and return to draw down
- 35:45ratio. report medium 75th percentile
- 35:5090th percentile 95%
- 35:54percent percentage sorry for my English
- 35:56and 90 99%
- 35:58draw down also report
- 36:01probability of finishing below zero
- 36:05probability of exceeding the historical
- 36:089% draw down probability of exceeding a
- 36:1110% draw down because
- 36:14we're we're already forward thinking
- 36:17about where we're going to use this
- 36:20inside of a prop account and 90 and
- 36:2595th percentile losing tree clearly
- 36:29explain that this analysis does not
- 36:32model future market regime change. So
- 36:34this is a protection that [laughter]
- 36:37codex is giving but it's it's totally
- 36:39fine. So we took the file we take the
- 36:41file once again. This is it. We're going
- 36:44to give it and we're going to ask one
- 36:48extra question which is
- 36:52give me an
- 36:56HTML file with a visual representation
- 37:03of the Monte Carlo test. Okay, let's go.
- 37:09So
- 37:11um
- 37:16what do we know? What do we know? Is it
- 37:18working? Right? Is it working? Uh we
- 37:21know that the historical draw down is
- 37:279%. Right? But after Monte Carlo
- 37:30simulation, we may discover a 12 or 15
- 37:33or larger draw down. It's plausible.
- 37:37This is particularly important because
- 37:39the strategy currently uses a 1% chance
- 37:431% of equity per trade. So for many prop
- 37:47firm accounts that might be too
- 37:49aggressive. If we reduce the risk from
- 37:511% to 0.5 the approximate percentage
- 37:55impact of every trade and draw down will
- 37:58also be reduced. So we we we should
- 38:01choose the risk based on unfavorable but
- 38:05plausible scenarios not the historical
- 38:08results. Is that clear? Do you guys have
- 38:12questions about this?
- 38:14This is very important.
- 38:19Right. So let's see what it gives us.
- 38:24It's going to take a little bit of time.
- 38:26So if you have question this is a good
- 38:28moment to ask
- 39:19>> [snorts]
- 39:34>> So, let's do this while we wait. It's
- 39:36going to take quite a bit of a time. Um,
- 39:40let's
- 39:41let's recap what we just did, right?
- 39:48Um,
- 39:59today we begin with the first working
- 40:01version of our opening range breakout
- 40:05strategy that we coded
- 40:08last week.
- 40:10This is the code, right?
- 40:18And we tested the first trade target
- 40:24reverse trade logic direction and day
- 40:26filters. We reached a candidate
- 40:29configuration with a 0.8 R
- 40:35uh first target 0.1
- 40:38second target reverse both directions
- 40:41enabled and Thursday disabled. And on
- 40:44the period show we got a 17% of total
- 40:48profit and loss. Max draw down on 9.15%.
- 40:53Win rate 61% profit factor 1.3.
- 40:58So we like it. We like this as a
- 41:01starting point. But we did not stop
- 41:04right here. That would be a a a crazy
- 41:07error. We added commissions. We added
- 41:13sleepage, order delay, limit
- 41:15verification and intraar detail.
- 41:20We exported
- 41:22the trades from here
- 41:25right
- 41:27into codeex together with the
- 41:28screenshot. Then we designed an out of
- 41:31sample test, work forward analysis, a
- 41:34parameter stability, cost stress test,
- 41:37multicar simulation. And the last thing
- 41:41that we're going to do probably
- 41:45probably next week. Yes, I believe we're
- 41:48going to do it next week. We're going to
- 41:51do a prop firm risk analysis. Right?
- 41:55That is going to be very very important
- 41:57and very very useful.
- 41:59And this is the difference between
- 42:03optimizing
- 42:04a strategy and believing an
- 42:07optimization.
- 42:09So the back test gives us a candidate.
- 42:13Validation decides
- 42:16whether the candidate deserves another
- 42:18step.
- 42:20Right? So in the next final episode,
- 42:24we're going to talk about prop firm risk
- 42:27analysis. that deal with the same
- 42:29results, same multicar results that
- 42:32Codex is producing right now. And we're
- 42:35going to go in depth on that. So we're
- 42:37going to note
- 42:39how much
- 42:41the the probability in percentage that
- 42:45we have to pass a two-phase challenge.
- 42:49So we're going to have let's say you
- 42:50have 63% of passing a the first stage of
- 42:55the classic challenge of Funpro. you
- 42:57have 73%
- 43:00of chance to pass the second phase and
- 43:04you have let's say I don't know um
- 43:0872%
- 43:11just random number just to give you an
- 43:13idea of
- 43:17probability to get your first $8,000
- 43:20payout
- 43:23right
- 43:24Um,
- 43:28and we we will also
- 43:32do the same. We're going to run the
- 43:34strategy in forward testing. We're going
- 43:37to create trading view alerts.
- 43:41We're going to build a structured web
- 43:45hook alert,
- 43:47which is this thing right here, right?
- 43:52Um,
- 43:54and we're going to connect the signal to
- 43:58the execution platform can be any third
- 44:01party platform. I'm not going to name
- 44:04any, but I'm going to tell you how it
- 44:06works, right?
- 44:09And um yes,
- 44:13of course, we're going to do couple of
- 44:15other things to add security like
- 44:20prevent duplicates or delayed orders. Uh
- 44:23add the daily loss protection or create
- 44:27a red button, an emergency stop button,
- 44:32right? and
- 44:35and we can prepare the bot for control
- 44:38use on a fun pro account. And what I'm
- 44:42going to do, I'm going to actually run
- 44:44this strategy on a fun pro two-phase
- 44:48classic challenge. Right?
- 44:52So this is where the project becomes a
- 44:55complete trading system rather than only
- 44:57a back test. I know today uh lesson it's
- 45:02quite complex. It's not very easy for me
- 45:06to explain. I hope I did my best to
- 45:09explain you guys all the steps, but you
- 45:11can go back in time and rewatch if you
- 45:13miss some part.
- 45:15It's not going to take more for you to
- 45:18do it more than a manual back test. I
- 45:22see people continuously going back and
- 45:26forth and back testing manual strategy.
- 45:29That's to me totally stupid. It's good
- 45:34at the beginning of your career to
- 45:38put your hands in the mud and understand
- 45:41stuff, watch things, create ideas, learn
- 45:45how to manually execute.
- 45:48>> [snorts]
- 45:48>> But when you got a little bit of
- 45:51experience,
- 45:53there's no point of
- 45:56one, trade manually and two,
- 46:01not to code a strategy, back test it
- 46:04automatically and deploy it. Right? So
- 46:09we have our results. Let's go take a
- 46:11look. There it goes.
- 46:14complete the completed the reproducible
- 46:17multiarl analysis uses 68 unique close
- 46:20trade. Again, this is a very small
- 46:24amount of trades. We want to go with a
- 46:26one year,
- 46:28500 trades, 600 trades, 700, 1,000
- 46:31trades. That is going to be best, right?
- 46:35Uh reshuffle
- 46:38bootstrap. We got the block three, we
- 46:41got the block five, and we got the block
- 46:4310. Look how beautiful this thing is and
- 46:46it's very very easy to use and
- 46:48understand.
- 46:50Okay. And you have all the matrix
- 46:52maximum draw down by by percentile.
- 46:56Uh with the reshuffle only we have z%
- 47:00probability to finish below zero. We
- 47:03have 50% finishing above 10%. And the
- 47:0890th 95th
- 47:11it's very difficult for me to pronounce
- 47:14percentile draw down is 16.3%.
- 47:19The selected method profile we got all
- 47:24all the summarizing right here.
- 47:29So
- 47:31what you can tell at the moment about
- 47:36this strategy
- 47:41is it going to be this is not a good
- 47:44prompt but to show you guys what we're
- 47:46going to do next week to be
- 47:49useful and potentially
- 47:53profitable
- 47:55on a Thunder Pro two steps classic
- 48:00challenge
- 48:02account.
- 48:03Am I going to
- 48:06um how
- 48:08many statistical
- 48:13probabilities
- 48:18[music]
- 48:23I would have
- 48:26to pass
- 48:29phase one and to pass phase two and to
- 48:35get a $1,000
- 48:39payout
- 48:41if and once funded.
- 48:45So, next week we're going to have a
- 48:47quick look, but next week I'm going to
- 48:49show you guys how to design
- 48:54stealing codeex or CL or whatever
- 48:59and give it a proper prompt
- 49:04to
- 49:06um
- 49:08understand
- 49:10if the strategy is going to be good and
- 49:15or profitable inside of a strat inside
- 49:18of a prop firm account. So, we're going
- 49:21to run a prop firm risk validation,
- 49:26right? We're going to give a proper
- 49:30um prompt. This is not a good prompt.
- 49:33This is a a super basic baseline, right?
- 49:37I'm going to show you how so you can
- 49:40copy paste the prompt that you can use.
- 49:44Right. Okay. Let's see what it what it
- 49:47says and we're going to finish this
- 49:50lesson. If you don't have any question,
- 49:52let me see in the chat if you have any
- 49:54question. Hi
- 50:01Roberto. Do you ever trade too or is he
- 50:04just talking? Roberto
- 50:08GF YS.
- 50:11Google it.
- 50:15I traded for more than one year. Allies
- 50:18recorded live. We took profits. We took
- 50:22losses. We took payouts. So this is an
- 50:25educational content. If you don't like
- 50:28it, GF YS,
- 50:33Google it.
- 51:02There he goes. Short answer. The
- 51:04strategy shows a potentially real edge,
- 51:06but I would not run it unchanged on a
- 51:08paid founder pro challenge. It is
- 51:10currently sightsee
- 51:13beneath fun prodown limits and the back
- 51:15test instrument blah blah blah blah
- 51:17blah. What the strategy currently
- 51:18demonstrates blah blah blah blah blah
- 51:20blah blah blah. Okay. So, what it's
- 51:22saying is
- 51:25we have pass phase one, we have a 79 to
- 51:3181% of chance to pass.
- 51:36Phase two, we have 85% and
- 51:40to get funded, we have a 93%
- 51:43of getting a payout. It says it's not
- 51:47perfect. We have to make it better. But
- 51:51this is a good starting point, right?
- 51:54So, thank you guys for being here with
- 51:56me today. Thanks again, Founder Pro for
- 51:58making this possible. I believe this is
- 52:00one of the best ever educational content
- 52:06that you can find on a prop firm because
- 52:10I'm telling you guys how to actually
- 52:15fool the prop firm. So, Fun Pro is going
- 52:19to hate me for that.
- 52:21Maybe they're going to delete this
- 52:25this series because if you follow this,
- 52:29hey, I'm not I'm not telling you to do
- 52:32it, but if you do this, you have a high
- 52:36chance to
- 52:38prepare, do nothing, watch the account
- 52:41growth, pass, and get your payout.
- 52:48That's it.
- 52:50Yeah, but Roberto, you have a SG and
- 52:54you're never going to be profitable.
- 52:57So, enjoy it.
- 53:00Um,
- 53:02so guys, thank you so much for being
- 53:03here with me today. Thanks for the hate
- 53:06from Roberto.
- 53:07Um, I wish he have a great career in his
- 53:11life. And thank you so much to my life
- 53:16for all the good questions. If you have
- 53:19any further question, ask it down below
- 53:22in the comment section. I'm going to
- 53:24reply every question. Thank you so much
- 53:26and I'll see you again on Monday on
- 53:29Wednesday for live trading and weekly
- 53:32preparation, midweek preparation. And
- 53:34next week on Friday, same time, we're
- 53:36going to finish the setup, have the
- 53:39final bot, and deploy it live and see
- 53:41how uh it's going to work. Thank you.
- 53:44Cheers, guys. Bye bye. Bye bye.
About this transcript
This page contains the full transcript of CODING TRADING AUTOMATIONS | July 31 | Michele Rossi by FunderPro, generated from the public captions YouTube serves with the video. The transcript has 5,565 words across 930 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.