vendredi 18 novembre 2016

buy stocks every second trading day of the month

Hello,

I have a porblem. I would like to buy my stocks not on the firhst trading day of the month but on the second.
So far I'm using this code:

newMonth = Month() != Ref(Month(), -1);
rotate = newMonth AND day() >1;
perf = TimeFrameGetPrice("C", inMOnthly, -1); // get monthly close price 1 month ago
perf1 = TimeFrameGetPrice("C", inMOnthly, -2); // get monthly close price 2 month ago

But it deos not work correctly.

Does andybody knows how to do this?

Thank you :)


buy stocks every second trading day of the month

Aucun commentaire:

Enregistrer un commentaire