Trading Articles
Article Categories
Article Tools
How to make my program sell short?
Updated July 9, 2014
trending_up
1,522 views
thumb_up
0 thanks given
group
2 followers
forum
3 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
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 and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How to make my program sell short?
(login for full post details)
#1 (permalink )
Honolulu + Hawaii / USA
Posts: 18 since Jul 2014
Thanks: 16 given,
1
received
Aloha,
Trying to have my program sell short the TF, once certain parameters are met. When I go to backtest the strategy it is not performing how I expected, with it selling short and then immediately triggering stop loss on days when there is a ski slope down. What am I missing? Since I am selling short, does the STP and TGT need to be negative?
Mahalo
{short Russell}
Inputs:
Price( Open ),
Length1 ( 12 ),
Length2 ( 15 ),
Cts ( 1 ),
TGT ( 300 ),
STP ( 100 );
Vars:
ExpAv1 ( 0 ),
PrevNetProfit ( 0 ),
PrevNetLoss ( 0 ),
StopTrading (false),
ROC1 ( 0 );
ExpAv1 = XAverage ( Price, Length1 ) ;
ROC1 = ( PRICE - PRICE[Length2] ) / PRICE[Length2] * 100 ; { RATE OF CHANGE }
if Date <> Date [1] then
begin
PrevNetProfit = NetProfit;
StopTrading = false;
end;
if NetProfit >= PrevNetProfit + 100 then StopTrading = true;
if Date <> Date [1] then
begin
PrevNetLoss = GrossLoss;
StopTrading = false;
end;
if GrossLoss >= PrevNetLoss + 80 then StopTrading = true;
{Buy or short sell contracts at exponential average crossovers}
if volume > 2000 and ROC1 < 1 and Price[1] crosses below ExpAv1[1] then
begin
Sellshort ( "sellshort") Cts contracts next bar at market ;
setprofittarget (TGT);
setstoploss (STP);
end;
value97 = text_new ( D, T, ExpAv1, "*" );
text_setcolor (Value97, Cyan);
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#3 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
honoluluhustler,
"Since I am selling short, does the STP and TGT need to be negative?" - No, the strategy will figure that out.
Why do you include the stop and target within the entry condition? This means they are only active when the entry conditions are. So you will likely have times when you are in the market, but without a stop and target.
Regards,
ABCTG
(login for full post details)
#4 (permalink )
Honolulu + Hawaii / USA
Posts: 18 since Jul 2014
Thanks: 16 given,
1
received
So move
Setprofittarget and setstoploss on the outside after the end;
if volume > 2000 and ROC1 < 1 and Price[1] crosses below ExpAv1[1] then
begin
buy ( "buy") Cts contracts next bar at market ;
end;
setprofittarget (TGT);
setstoploss (STP );
Last Updated on July 9, 2014
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April