View Full Version : Intra Day Entry
strw23
6th January 2006, 04:48 PM
Hello
I was wondering if it was possible to have an intraday entry on tradesim?
For example
If my trigger was when the close crosses the 3 day high I want this to be my buy price not the open of the next day. I know the entry price has to be in the range of todays Low and High but when I try coding it it doesnt work, I just keep geting errors and all my securities rejected. Below is what I have tried, if somebody else could shed some light on it please that would be great.
Scott
I tried
LongEntryPrice:= max(OPEN,Ref(HHV(H,3),-1)+0.01 );
and I tried
LongEntryPrice:= Ref(HHV(H,3),-1)+0.01;
LongEntryPrice:= If(OPEN>= Ref(HHV(H,3),-1)+0.01,OPEN,LongEntryPrice);
Jose
7th January 2006, 04:09 AM
Try this:
{ Close crosses the 3-day High }
LongEntry:=Cross(C,Ref(HHV(H,3),-1));
LongEntryPrice:=C;
If trading the signal on the next day:
{ Yesterday's Close crosses the 3-day High }
Setup:=Ref(Cross(C,Ref(HHV(H,3),-1)),-1);
LongEntryTrigger:=Setup AND H>=Ref(C,-1);
LongEntryPrice:=Ref(C,-1);
jose '-)
strw23
7th January 2006, 09:54 AM
Jose I will try this tonight but the problem I see is that what you have wriiten will enter at the close price. I want to enter at the price were it crosses the 3 day high or the open whichever is higher. I have got the trigger right but the entry price is what keeps rejecting my securities. I will try your code and then try and modify it if it doesnt work and I will let you know.
Thanks
Scott
Jose
7th January 2006, 05:08 PM
the problem I see is that what you have wriiten will enter at the close price.
It will enter at the Close, but only an a valid trigger. The key is in the correct EntryTrigger, and not in the EntryPrice.
Add some slippage for a more realistic EntryPrice.
jose '-)
strw23
7th January 2006, 10:42 PM
Hello Jose
Entering at the close defeats the whole purpose of what I want to do and this tread "intraday entry" not end of day entry. In the tradesim manual it has a picture that displays the possible paramatters for the entry price and they have to be between the low and the high on entry day. Why wont it work if on the day it is triggered I put the entry price at the highest point of cross 3 day high or the open. One of these will be in the valid range. I know I have all my other code right because it works until I change my entry price and then it rejects all my securities. I am at work now but will upload all my code later on for you to look at, or can this just not be done? Thank you for the time you have put in already.
Scott
sectorbets
7th January 2006, 11:55 PM
You can force an entry price to just about anything you want, although it probably isn't realistic in the real world. For example, I force entry prices to (O + H)/2 for longs and (O + L)/2 for shorts just to try to force some reality to my models. I then run the simulations with these prices as the base case and then use market option for entries/exits to see what difference there is--the answer is not much, so I am happy with the approach.
Jose
8th January 2006, 02:29 AM
Entering at the close defeats the whole purpose of what I want to do and this tread "intraday entry" not end of day entry.
Scott, you are not entering on the Close, but entering the next day at the previous' day Close, when conditions are valid.
Rather than attempting to interpret the code, plot both signals and EntryPrice on a chart, and see if it does what you expect it to.
Why wont it work if on the day it is triggered I put the entry price at the highest point of cross 3 day high or the open.
Because the highest point of cross 3 day high may fall outside the day's High/Low range.
If you are not sure if your EntryPrice is valid, you can always limit the EntryPrice to the day's price range this way:
EntryPrice:=Ref(C,-1);
EntryPrice:=Max(Min(EntryPrice,H),L);
This is all I can help with for now.
jose '-)
strw23
8th January 2006, 02:30 AM
Sectorbets, I am trying to force the open price to be the highest point in the last 3 days (not including today) or if this is bellow the range I want it to be the open. My problem is I cant get this to work and it keeps rejecting every security in my exploration.
Scott
Polikarpos
30th January 2006, 12:16 PM
Scott, you immediately have a problem trying to enter intraday on the condition of the Close crossing the 3 Day High. The Close price is generated at the conclusion of the trading session. Therefore, the closing price is the only vaild entryprice for the conditions of entry presented. Should you require an intraday entry for any parcel traded above the 3 day High to generate a buy, try the following code
{Entry Trigger}
LongEntry:=Cross(H,ref(HHv(h,3),-1));
{entry Signal}
B1:=ref(HHv(h,3),-1);
{Tick Price}
v1:=If(B1<=0.099,0.001,
If(B1>0.099 AND B1<=2.00,0.005,
If(B1>2.00,0.01,0)));
LongEntryPrice:=If(H<B1+v1,H,If(L>B1+v1,O,B1+v1));
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.