TradersStudio Thread

Quote from samuel_weber_74:

Can anyone help me with this ? Thanks.
As exercise I wrote a system to trade inside days.
If today is an inside day I place an order to buy tomorrow 1 tick above today's high and a second order to sell 1 tick below today's low.
I also place 2 profit targets for tomorrow and the next days. Let's say this target is 5 ticks. Too small for a profitable system in reality but a very close profit taking limit order fits well in this example. If today is an inside day, it is likely that tomorrow one of the stop orders will be filled and also that the limit order above/under it will be touched exiting me from the position..... well, it does not happen ! The stop order is filled, let's say I am long, the profit target is hit, too, but the position is not exited at that price ( with the limit order ), it is exited only the next day on the open !!
I am sure I missed something. If someone could help ....
I tried everything ... my head is spinning !
This is the code:

Code:
 Sub Inside_Days_prova(PercOfBar)

    Dim InBar
    Dim StopXLong
    Dim StopXShort
    Dim Value1
    Dim Value2
    

    InBar = High < High[1] And Low > Low[1]
    If MarketPosition=0 And InBar Then   
        Buy("Long", 1, H + GetActiveMinMove(), Stop, Day) 
        Sell("Short", 1, Low - GetActiveMinMove(), Stop, Day)
        
        Value1=Max(H,NextOpen(0))+PercOfBar/100*(H-L)
        Value2=Min(L,NextOpen(0))-PercOfBar/100*(H-L)             
        ExitFirstDayLong("","Long", 1, Value1, Limit)
        ExitFirstDayShort("","Short", 1, Value2, Limit)
        
    End If
    
    If MarketPosition > 0 Then        
        ' Profit Target
        If Date = EntryDate Then 
              StopXLong=L[1] - GetActiveMinMove()
              Value1=EntryPrice+PercOfBar/100*(H[1]-L[1])
        End If
        ExitLong("", "", 1, StopXLong, Stop, Day)              
        ExitLong("", "", 1, Value1, Limit, Day)
    End If
    
    If MarketPosition < 0 Then
        If Date = EntryDate Then 
              StopXShort=H[1] + GetActiveMinMove()
              Value1=EntryPrice-PercOfBar/100*(H[1]-L[1])
        End If
        ExitShort("", "", 1, StopXShort, Stop, Day)              
        ExitShort("", "", 1, Value1, Limit, Day)
    End If
    
    marketbreakdown()
End Sub

I also attach a screen shot: you see, the position in not exited at the limit order's price but the next day on the open.

Value1=Max(H,NextOpen(0))+PercOfBar/100*(H-L)
Value2=Min(L,NextOpen(0))-PercOfBar/100*(H-L)

Why are you looking at tomorrow open in this case, Is that what you want to do, or are you comparing the H and L to todays open ?. We will work on this example for you , but I want to understand what you are trying to do.
 
Quote from samuel_weber_74:


I can understand protecting the backtester but, for the same reason, it is much more important to be sure orders are filled exactly as the user coded them ( just my humble opinion ).

Maintaining the integrity of the backtest is always one of the prime directives of any credible backtest platform. You should be delighted that it is there.

Murray's suggestion of using a tradeplan to separately manage the long and the short side sounds to me like it should work. That said, it's doesn't sound like a great solution looking forward. But at least they acknowledge that and are working on something.

BTW, i looked at something like this a while back. I was leaning towards doing it using intra-day data but decided the effort, and risk of a logical screw-up, vs the reward was too great.

I do wonder whether Tradersstudio would benefit from another layer of session level abstraction but who am I to say.


Thx
D
 
Hello Murray,
I am NOT criticizing anything. I am simply asking ! :)
To get accustomed to program effortlessy your software I decided to take inspiration from some of the patterns described in L.B. Raschke's book. By the way TradersStudio, as written in the manual, looks great for pattern testing.

Let's examine only the long side to make things simpler. If today is an inside day I place an order to buy tomorrow 1 tick above the high. Profit target, say, five ticks above the entry price.
I compare today's high with tomorrow's open to know what my entry price will be - I need to do this to calculate the profit target - because I could be filled on an open higher than the inside day's high. In this latter case of course the target price must be 5 ticks above tomorrow's open.

Can I have a profit taking limit order and a stop loss for the day of entry too ?
 
If you could also insert in the code an example of the proper use of EntryDate.
I tried " If Date=EntryDate then Print EntryPrice" but I failed.

Thanks Murray !
 
Quote from samuel_weber_74:

If you could also insert in the code an example of the proper use of EntryDate.
I tried " If Date=EntryDate then Print EntryPrice" but I failed.

Thanks Murray !

ENTRY DATE IS NOT AVAILABLE ON ENTRY BAR, BUT ON THE NEXT BAR. I HAVE LOOKED AT YOUR SYSTEM BUT I AM TESTING IN THE NEW BETA, I DON'T HAVE 2.5.5 HANDY AND GOT SOMETHING WHICH LOOKS OK, BUT HAVE NOT CHECKED CLOSELY.

WILL UPLOAD REPORT , IN A BIT.
 
Can I have a profit taking limit order and a stop loss for the day of entry too ?

Not in 2.5, we are trying to address this in Professional at least under some conditions. Like I explained this could create problems, You get in on a stop, then get stopped out and then rally to target you lose money, but it would look like you made money on a daily bar. If you rallied , collapsed; get stopped out and then rerallied you lost money.
 
Here is my output using the current beta.

I changed nextopen to open. This was done with the current beta.

I only changed nextopen(0) to open.

If it does not work like that you can contact sales and get put on the beta list when we reopen the beta list next week. You will need to sign a beta agreement.
 

Attachments

I do not have excel.
Ok. No limit order to take profit on the entry bar.
What is the reserved word to place a stop loss on the entry bar ? You said you have special functions to do it.
Can you post here the code you have written, so I can understand how to write this signal in the proper way ?
 
Hi Murray,

Sorry to bother you but I am having trouble trying to load a sample selection of intra day data that I received from TickData.

I use their software and modify the data to a ASCII file in 30 minutes lines.

When I try to get Traders Studio to recognise it I ge an error message.

Any ideas???


Below are a few sample lines from the data

20060201,09:00,1281.25,1283.25,1281.25,1281.50,93803
20060201,09:30,1281.50,1286.50,1280.25,1285.25,126037
20060201,10:00,1285.50,1286.50,1283.25,1283.50,76206
20060201,10:30,1283.50,1286.25,1281.50,1282.75,79385

The format is

ccyymmdd,HHMM,Open,High,Low,Close,Volume

The TXT file I generated ends up looking like this...

delimit=,
skip=0
dt=1
ti=2
op=3
hi=4
lo=5
cl=6
vol=7
oi=0
dtformat=CCYYMMDD
tiformat=HHMM

The error message I get from Traders Studio is

"Directory(name of my data directory) contains invalid files or does
not contain files at all".

Thanks for any help you (or anyone) may provide on this.

I want Intra Day data regarding Currency Futures, Forex and Indexes. If you have any other ideas on data apart from Tick Data please let me know.

All the nest,

Andrew

Andrew
 
Back
Top