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)
The adviser remembers the closing of the previous day. At the opening of the next day, if the price is higher than the closing of the previous day, we buy and put a stop. if the price is lower than the closing of the previous day, we shell and put a stop. If the stop is working revers positin. Close position end of day
Can you help answer these questions from other members on NexusFi?
If you have not tried the TradeStation forum, I would try your strategy request there. They have an employee that will write code for forum members. He gave me the code for a similar strategy that would buy on open with an X number of points gap down. The timed exit was variable as well as the gap and the stop.
// Buy condition
If Close > PrevClose then
begin
Buy ("Long") next bar at market;
StopPrice = Close - (Close * StopPercent / 100);
end;
// Sell condition
If Close < PrevClose then
begin
SellShort ("Short") next bar at market;
StopPrice = Close + (Close * StopPercent / 100);
end;
// Check for stop loss
If MarketPosition = 1 and Low <= StopPrice then
begin
Sell ("Sell Stop") next bar at StopPrice at stop;
BuyToCover ("Reverse to Short") next bar at market;
end;
If MarketPosition = -1 and High >= StopPrice then
begin
BuyToCover ("Cover Buy Stop") next bar at StopPrice at stop ;
Buy ("Reverse to Long") next bar at market;
end;
// Close positions at the end of the day
If Time = 2300 then
Sell ("Clo Long") next bar at market;
If Time = 2300 then
BuyToCover ("Clo Short") next bar at market;