i have writhe this but don't work well
Code: Select all
Input: MyStopLoss(1100);
If dayofmonth(date)=1 and CloseM(1) < OpenM(0) then buy this bar at close;
setexitonclose;
setstoploss(MyStopLoss);
Code: Select all
Input: MyStopLoss(1100);
If dayofmonth(date)=1 and CloseM(1) < OpenM(0) then buy this bar at close;
setexitonclose;
setstoploss(MyStopLoss);
Code: Select all
If Month(Date) <> Month(Date[1]) ....
Code: Select all
Input: MyStopLoss(1100);
If Month(Date) <> Month(Date[1])then begin
If dayofmonth(date)=1 then buy this bar at close;
end;
setexitonclose;
setstoploss(MyStopLoss);
Most probably these months fall into MaxBarsBack bars.thanks fury,
I tried so but skips a few months
Which months are missing?how can I write a formula that buy in opening the first day of every month?
i have writhe this but don't work well
Code: Select all
Input: MyStopLoss(1100);
If dayofmonth(date)=1 and CloseM(1) < OpenM(0) then buy this bar at close;
setexitonclose;
setstoploss(MyStopLoss);
Code: Select all
If dayofmonth(date)=1 ...
ps.thanks fury,
I tried so but skips a few months
Code: Select all
Input: MyStopLoss(1100);
If Month(Date) <> Month(Date[1])then begin
If dayofmonth(date)=1 then buy this bar at close;
end;
setexitonclose;
setstoploss(MyStopLoss);
Thanks for sharing your code.thanks guys for the support I solved with this formula and it works
If Month(Date) <> Month(Date[1])then begin
If ((dayofmonth(date)=1)or(dayofmonth(date)=2)or(dayofmonth(date)=3)or
(dayofmonth(date)=4)or(dayofmonth(date)=5))
then buy this bar at close;
end;
Code: Select all
If Month(Date) <> Month(Date)[1] then
begin
buy ... ;
end;