Forum Replies Created
-
AuthorPosts
-
JulianCohenParticipant
Amazingly all it needed was for me to write out this post and go have a shower. The answer came to me in a blinding flash! Maybe next time I won’t write the post and just have the shower and see if that also works….it is after all a process of elimination for me most of the time.
JulianCohenParticipantI also had problems wading through the maths, in fact I didn’t ha ha. But I read it as they compared the ROC for January over the last 20 years, then Feb for the last 20 years then March etc etc…to give a kind of correlation matrix for each month over the last 20 years. They are then saying you can see a pattern that some months are bullish and some are bearish. That’s my reading of it but I’m open to corrections
JulianCohenParticipantThis might be a little bit too much for me at the moment coding wise, but you guys might want to play around with this idea:
http://blog.alphaarchitect.com/2016/05/18/return-seasonalities-are-everywhere/#gs.LozC_Oo
JulianCohenParticipantI’ll go back and look it up. Thanks Craig
JulianCohenParticipantJust a quick question. When do you use OpenInt as opposed to Close?
JulianCohenParticipantI hope to make it. I will be in Abu Dhabi and they frown on anything that circumvents their own telecoms, what’s app calls, FaceTime and Skype don’t work. Hopefully this will.
JulianCohenParticipantI just read the Dual Momentum book. Basically I think it can be summed up as follows:
Compare ROC(252) of SPY index against a world index ETF…he suggests VEU
If the higher of either is higher than the ROC(252) of BIL, a bond index ETF, then buy the stock ETF. Otherwise buy the Bond ETF. Recheck each month.
That’s it…keep it simple :cheer:
It can easily be adapted to compare other index ETFs against each other etc…
It could be added to a system as an additional unit.
I’m quite a way behind you guys in coding but happy to test and contribute if I can
JulianCohenParticipantIt always makes sense when you know how to do it
You have been a great help. Thank you
JulianCohenParticipantThanks Said so much…it’s 95% there now. I should be able to tweak the rest. Appreciate the help VERY much. I was getting a massive headache!
JulianCohenParticipantSo remove it from the looping completely?
JulianCohenParticipantI want the stop to stay in one place.
I will buy one tic over the top of the set up bar and create a stop loss 1 tic below the set up bar. That S/L will stay in place until hit or the C>SMA exit works.
That’s what I am trying to do…
JulianCohenParticipantTrent…It makes sense but it didn’t work haha…Thanks anyway. It’s given me another 1000 things to try
JulianCohenParticipantYou’re right…Appreciate it.
JulianCohenParticipantThanks Trent…doesn’t this code in the looping cover that occurrence?
if (LBIT[j]>1 AND LEx[j]) //Exit on SMA
{
Sell[j] = True;
SellPrice[j] = Max(Open[j],SMA[j-1]);
PriceAtBuy = 0;It appears to be working correctly at first glance but I got so hung up with trying to work out the initial stop I haven’t had a good look at that yet.
JulianCohenParticipantWith this code my trailing stop is always either 0 or 1 and I can’t figure out why. What painfully obvious thing am I missing?
Code://=================================================================================
//Entry and Exit Signals
//=================================================================================Cond1 = L < Ref(L,-1); Cond2 = BullDB > ClsSt;
Cond3 = H < SMA; Cond4 = C > SMA;
Cond5 = OptFilt AND IndexUp AND UniverseFilter AND HDBFilter; //All the optional filtersOnLastTwoBarsOfDelistedSecurity = BarIndex() >= (LastValue(BarIndex()) -1) AND !IsNull(GetFnData(“DelistingDate”));
OnSecondLastBarOfDelistedSecurity = BarIndex() == (LastValue(BarIndex()) -1) AND !IsNull(GetFnData(“DelistingDate”));BuySetUp = Cond1 AND Cond2 AND Cond3 AND Cond5;
Buy = Ref(BuySetUp,-1);
BuyStop = H + 0.01;
SellStop = L – 0.01;LE = Ref(BuySetUp,-1) AND H >=Ref(BuyStop,-1) AND NOT OnLastTwoBarsOfDelistedSecurity;// TRIGGER BAR Entry is all conditions fulfilled and above the BuyStop
LEPrice = Max(Open,Ref(BuyStop,-1)); //Entry PriceLEx = C > SMA; //Long Exit
LIS = Ref(BuySetUp,-1) AND L <=Ref(SellStop,-1) AND NOT OnLastTwoBarsOfDelistedSecurity; //Initial stop a tic below SetUpBar //-------------------------------------------------------------------------- //MCS code part 2 if(MCP) LE = LE && Random()*100>=MCP; // Identifier MUST match the Identifier in the trigger bar line above
//————————————————————————–//=================================================================================
//Looping
//=================================================================================
Buy = 0;
Sell = 0;
PriceAtBuy = 0;
LBIT = 0;
LStop = Null;
//=================================================================================
for (j = 1; j < BarCount; j++) { if (PriceAtBuy==0 AND LE[j]) { Buy[j] = True; PriceAtBuy = LEPrice[j]; BuyPrice[j] = LEPrice[j]; LStop[j] = LIS[j-1]; LStop[j-1] = LIS[j-1]; LBIT[j] = 1; if (LBIT[j]>1 AND L[j] <= LStop[j-1]) { Sell[j] = True; SellPrice[j] = LStop[j-1]; PriceAtBuy = 0; } } else if (PriceAtBuy > 0)
{
LBIT[j] = LBIT[j-1]+1;if (LBIT[j]>1)
{
LStop[j] = LStop[j-1];
}if (LBIT[j]>1 AND L[j] <= LStop[j-1]) { Sell[j] = True; SellPrice[j] = LStop[j-1]; PriceAtBuy = 0; } if (LBIT[j]>1 AND LEx[j]) //Exit on SMA
{
Sell[j] = True;
SellPrice[j] = Max(Open[j],SMA[j-1]);
PriceAtBuy = 0;
}
}
} -
AuthorPosts