My algo trading daily performance

rammmeo

Active Member
Hello MT,

As i said before i am also doing system trading but manually since mine is a swing system. I want to ask is that how to backtest in ami broker for intraday. Do i have to make any changes in the afl or there is some option in settings that needs to be activated.

Thanks
 

mechtrader

Well-Known Member
Hello MT,

As i said before i am also doing system trading but manually since mine is a swing system. I want to ask is that how to backtest in ami broker for intraday. Do i have to make any changes in the afl or there is some option in settings that needs to be activated.

Thanks
For intraday testing, you have to write logic in the afl to close all positions at EOD.

MT
 
Hello MT,

As i said before i am also doing system trading but manually since mine is a swing system. I want to ask is that how to backtest in ami broker for intraday. Do i have to make any changes in the afl or there is some option in settings that needs to be activated.

Thanks
@rammmeo

This below AFL code will help you :-
Logic in the afl to close all positions at EOD.

In order to code a strategy that triggers trades only in certain hours of the day, 9:30-11:00 in this example, we can use the following approach (code uses simple MACD crossovers to generate signals):

Code:
tn = TimeNum();
startTime = 93000; // start in HHMMSS format
endTime = 110000;  // end in HHMMSS format
timeOK = tn >= startTime AND tn <= endTime;

Buy = Cross( MACD(), Signal() ) AND timeOK;
Sell = Cross( Signal(), MACD() ) AND timeOK;
It is also possible to force an exit signal after 11:00 to avoid overnight positions:

Code:
tn = TimeNum();
startTime = 93000; // start in HHMMSS format
endTime = 110000;  // end in HHMMSS format
timeOK = tn >= startTime AND tn <= endTime;

Buy = Cross( MACD(), Signal() ) AND timeOK;
Sell = (Cross( Signal(), MACD() ) AND timeOK) OR Cross( tn, endTime );
Thanks Arjun
 
Last edited:

mechtrader

Well-Known Member
Hi all,

The inevitable happened. The winning streak ended. This was the first loss month after 14 months since Dec 2014. But its ok. Everything was normal this month, all according to the plan.



After trading 5 months with the new lot sizes, i am fairly comfortable in all aspects now (i like to think that). SO, the march expiry i will be going live with full model (i was trading the toned down version till now).
==> The capital is not a worry now.
==> I am getting good odds, as the model is down 3l from its peak . hence the max drawdown has been reduced by 3l.

Hope all works out well. Wish me all the best guys. I need it, trust me.

MT
 
Last edited:

copypasteaee

Humbled by Markets
Hi all,

The inevitable happened. The winning streak ended. This was the first loss month after 14 months since Dec 2014. But its ok. Everything was normal this month, all according to the plan.



After trading 5 months with the new lot sizes, i am fairly comfortable in all aspects now (i like to think that). SO, the march expiry i will be going live with full model (i was trading the toned down version till now).
==> The capital is not a worry now.
==> I am getting good odds, as the model is down 3l from its peak . hence the max drawdown has been reduced by 3l.

Hope all works out well. Wish me all the best guys. I need it, trust me.

MT
Wish you good luck my bro. I hope you will be a big success story :thumb::thumb:
 

DSM

Well-Known Member
Oops....

Sorry to hear the positive streak is broken. And considering it is after 14 successive wins, wondering if there was any changes in the system/strategy or structure of the market? Anything different in the trades that were taken?
Wondering....

Good luck to you. Looking fw. to see you bounce back. :thumb:


Hi all,

The inevitable happened. The winning streak ended. This was the first loss month after 14 months since Dec 2014. But its ok. Everything was normal this month, all according to the plan.

After trading 5 months with the new lot sizes, i am fairly comfortable in all aspects now (i like to think that). SO, the march expiry i will be going live with full model (i was trading the toned down version till now).
==> The capital is not a worry now.
==> I am getting good odds, as the model is down 3l from its peak . hence the max drawdown has been reduced by 3l.

Hope all works out well. Wish me all the best guys. I need it, trust me.

MT
 

mithoon

Active Member
Don't worry MT ,such a month is very natural in trading ,im sure next moth would be great ,starting from tomorrow,all the best...
Hi all,

The inevitable happened. The winning streak ended. This was the first loss month after 14 months since Dec 2014. But its ok. Everything was normal this month, all according to the plan.



After trading 5 months with the new lot sizes, i am fairly comfortable in all aspects now (i like to think that). SO, the march expiry i will be going live with full model (i was trading the toned down version till now).
==> The capital is not a worry now.
==> I am getting good odds, as the model is down 3l from its peak . hence the max drawdown has been reduced by 3l.

Hope all works out well. Wish me all the best guys. I need it, trust me.

MT
 

mechtrader

Well-Known Member
Oops....

Sorry to hear the positive streak is broken. And considering it is after 14 successive wins, wondering if there was any changes in the system/strategy or structure of the market? Anything different in the trades that were taken?
Wondering....

Good luck to you. Looking fw. to see you bounce back. :thumb:
Hi DSM,
There is absolutely no reason as to why this happened. It is just a regular lean period. This happens all the time. I dont think that there was some structural change in the market not did I do anything different.

People ask me how many months have you been profitable and I always think that is it the right barometer to measure success. I think it is not. I mean a person can be profitable all 12 months with 2% return every month and another person can be profitable every other month with 6 months with - 5% return and rest 6 months with 50% return. Which one is better is clear, although he is only 6 months positive. So in all, the barometer to success should be the profitability in the long run.

Another point of view is that we can't put any limits on the market.
Let's take 2 scenarios...
1)Maybe if last day of the expiry I would have got a big profit then all my looses in the month would have vanished and the month would have been positive.
2)maybe that day happens tomorrow and that is the first day of the next expiry.
Now, what is the difference between both the scenarios. There is none. Both are equally likely to happen. Again, all I want to say is boundaries and limits can't be applied to the market.
Another example that I can cite for the above situation is... People always tell me they trade 5 min, 10min or whatever and they take decisions on the close of the candle always because it somehow makes logic for them. But it doesn't for me, because I believe market is a continuous stream of data and it doesn't even know where is your 5min or 10min close. Neither does it care. We can't ever set boundaries for it.

All of the above are just my views, I was reassuring myself time and again in this long post, than replying to your query.

Thanks for the concern... Good luck to you too for the series ahead.

MT