View Full Version : Gaps above Entry signal
Michael
31st August 2003, 09:01 AM
Could someone please help with code where there is a gap above the Long Entry Signal? I've got an EntryTrigger when price moves above yesterdays close, but I can't work out how to get the Entry to occur at the next Open if there is an upwards gap.
I've tried adding ">=" in: LongEntryPrice:=Ref(C,-1)+.01, but get error messages however I write it.
Any suggestions gratefully received!
David Samborsky
1st September 2003, 01:23 AM
The reason why the trade is rejected when the price gaps is because when you reference yesterdays price, due to the price gap you are forcing the price (yesterdays close) to lie outside the price range on the following day. TradeSim won't allow you to synthesize prices that don't exist in reality. You will need to add some more conditioning in the expression for the price in the event that the price gaps.
You could try something like this which checks to see if todays price range encompasses yesterdays closing price and readjusts the price to a valid price if it doesn't.
EntryPrice:=if(L>ref(C,-1),L,if(H<ref(C,-1),H,ref(C,-1)));
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.