Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
not a problem....if I was at my machine I could actually send it to you...on vacation…will be home next week.....tradestation doesn't have a parameter driven programming language???
Can you help answer these questions from other members on NexusFi?
it probably does but i'm still not sure how to use all the functionality and i'm still trying to understand the logic behind coding thats why seeing examples really helps me.
I'm a trader turned coder not a coder with an idea!
If I cant figure it out maybe i'll reach back out to you on here next week?
Could someone write for me the code to do the following?
Given an "identified" bar, I want to buy at this bar HIGH and sell short at this bar LOW and (VERY IMPORTANT) want to keep the order valid not only for next bar but also for all subsequent bars till a new "identified" bar takes place.
Market Position is always = 1.
Intrabar order generation is true as I want to enter the trade as soon as the price reaches one of the thresholds. Please see the attached picture for your better understanding.
I am looking for exactly this as well. I want to enter the trade when the level of a previously identified bar break. NOT on close of the bar that breaks it. I have intrabar order generation and look inside tick as well. It still wait until bar close, which is not good.
I'm trying to write a strategy that looks at the first hour of trading and then buys or sells short based on the price after that hour. if the price moves under the low of the hour I want to sellshort, and vice versa for the high. intrabar order generation is true as I want to enter the trade as soon as the price crosses one of the thresholds.
My code looks something like
Value1 = lowd(0)
Value2 = highd(0)
If time>1030 and close>value2 then buy next bar at market
else
if time <1030 and close<value1 then sellshort next bar at market
End;
For some reason this isn't working as looking back over years of data generates 0 trades.
Appreciate anyone who can help!
Thanks
==========================
If you move the value1 and 2 lines below the other code then it will work by using the values from the previous go round.
If Value1 <> 0 and Value2 <>0 then begin
If time>1030 and close>Value2 then buy next bar at market
else
if time <1030 and close<Value1 then sellshort next bar at market
End;