Code:
def entry = GetDayOfMonth(GetYYYYMMDD()) > 1 and GetMonth() == 12;
def exit = GetDayOfMonth(GetYYYYMMDD()) > 20 and GetMonth() == 12;
AddOrder(OrderType.BUY_TO_OPEN, entry, open);
AddOrder(OrderType.SELL_TO_CLOSE, exit, close);
the 1 would represent day 1 of dec and i suspect around 20 days out of 30 for the entire month so on the average maybe 20 trading days in the month.
Can anyone offer suggestions as to how i can make this work.. Not knowing the exact number of trading days in each month, i just used day 1 and day 20 as there will normally be approx 20 days per month.. Maybe i can figure out how to calculate the actual days of trading in each month later.. But having most of the days will suffice for now. Depending on what timeframe you choose, i want it to calculate the profit on each candle FOR THE MONTH CHOSEN SUCH AS 12 FOR DECEMBER. If an open is started on the opening of the first candle and a close on the close of the same candle the Report will then show the profit or loss for each candle depending on the date like above is 12 for December.. If working the way i hope to get it working that would go thru each candle in the month of december. The TOS autogenerated Report should then show profit and loss by candle for the entire month of December. Actually i would only be using it for timeframe of one yeasr and the number like 12 above would calculate only the month of Dec or you change the 12 to a 4 it would than calculate day by day profit or loss for the month of April and enter it into the TOS report that it automatically calculates with say like 20 dated entries for each candle. It could have the timeframe set to 1year, 1 day and should make 20 entries for the 1 hour candles for them entire month. Or you could set the time frame to 1 day 4 hours and only get 2 entries per day in the log. Hope all this makes sense.
Bottom line is that i am trying to get the profit and loss for each candle for each day of the month.. Month selected by for example 12 above for
December.
if an open is processed on each opening candle a close is done on each candle that is open.. Should place in the Report the profit and loss of each candle in the month that is being processed.
Last edited by a moderator: