SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Feb 28, 2020 10:18 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Jan 29, 2011 10:45 pm 
Offline

Joined: Mon Dec 06, 2010 2:15 am
Posts: 47
Greetings all,

I'm working on some code which I can use with another indicator based setup. What I want to accomplish is to measure the PnL of the most recent position closed, and then after measuring if that position was a profit or loss, allow the next trade to be immediately executed with the next trade indicator event by having the Bool entryEnabled = true; or have the code delay the next possible trade until N bars have passed and closed.

My first instance was to code this in the onPositionClosed (); method but I'm not sure if this is the best idea, because I need to incorporate a bar++ count and well as the entryEnable Bool with OnBar(); method. I've been able to pull the PnL using portfolio.Transaction method, but I'm don't know how or where to have the program count the bars as they need to be counted almost whether entryEnabled is true or false.

Looking for a little direction here, let me know if posting some code would help.

Thanks,
Red


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group