How to increment Time using Strategy Parameters?
Author: joannakim
Creation Date: 9/11/2010 11:44 AM
profile picture

joannakim

#1
Hi. We are running a strategy that we programmed. We had specified the in the code the StartTradeTime,StopNewTradeTime and EndTradeTime. Obiously the first parameter is when the trading is allowed to start, the second one is the time when it should stop taking new trades and the third is when we exit the trade. When I try to run the back test, and try to move the slider on the EndTradeTime to customize the exit time for that particular run of backtest, the slider moved in the increment of 10 (because we specified the interval as 10 in the code,) but it goes all the way up 90 then 100: it is on 100 scale rather than 60 scale that the clock is on. So if I wanted to set the slider to exit the trade at 10:30 Am, should I set the slider at 1030 or 1050? And is 1090 actually something like 10:52AM or is it 11:30 AM? Thanks.

Joanna
profile picture

Eugene

#2
The parameter slider doesn't have anything to do with the time. It's an integer variable with 10 as the increment (as programmed), and nothing more. For it to work, you need to find out how to increment time in C# through the DateTime.AddMinutes() method, and add this to your Strategy code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).