stop trading after num wins with delay

binthere

Newbie
Messages
1
Likes
0
hi guys
i'm a newbie and need help!!
using tradestation 8.8
what i need is to be able to have the strategy do the following during the trading session
1)count number of wining trades
2)count the number of loosing trades
3)stop trading for a # of minutes after the defined number of wins and also stop trading after a # of loosing trades
Inputs:
TradesWin ( 20 )
TradesLoose ( 4 )
TradeWinPauseMins (10)
TradeLoosePauseMins (45)
with the above described inputs the strategy should
-pause trading 10 minutes after 20 winning trades and resume trading after the 10 mins went by
-pause trading for 45 minutes after 4 loosing trades and resume trading after 45 mins went by

so what i need is a counter for TradesWin with minutes delay after the # of wins are traded and
a counter for TradesLoose with a minute delay after the # of loosers are traded

i would really appreciate your help, completely lost on this one
thanking you in advance
cheers, binthere
 
Hi Binthere,

var: Numwin(0), NumwinToday(0);
If currentsession(0) <> currentsession(0)[1] then Numwin = numwintrades;
If currentsession(0) = currentsession(0)[1] then NumwinToday= numwintrades-Numwin;

here Numwintoday will help you to find number of win trades during trading session. Similarly you can follow for finding Number of losing trades during trading session.

To pause the trading,
If Numwintoday = TradesWin then store the time and calculate it to trade after 10 mins,
similarly If Numlosstoday = TradesLoose then store the time and calculate it to trade after 45 mins,
If you need further help,
Please contact me.

Regards
PrathapJay
 
Top