Hello , I need help with writing afl code to day trading system called : Crucial Time Of Day (Bernstein).The system assumtions :
- 5 minute closing price from the first 2 hours of trading (session) - the highest price as buying brakout point - the lowest price as buing breakout point - Buy signal occurs when price have had 5 minute close above the highest 5 minute closing plot established during first 2 hours. - Sell signal occurs when price have had 5 minute close below the lowest 5 minite closing plot established during first 2 hours. Buy = Cover Sell = Short Closing postion at EOD. I have only something like this: // ForceCloseTradesAfter = 160600; ( closing at time 16:06 ) Buy=Cross(C,Ref(HHV(C,19),-1)); // The problem is to open position alfter 2 hours using conditions specified above.I know that HHV is not a good idea in this case and i suppouse something with Bar since or value when should be used. Sell=Cross(Ref(LLV(C,19),-1),C) OR (TimeNum() > ForceCloseTradesAfter); // Greetings Mateusz
