Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Gold Customer
Joined: 5/20/2010 Posts: 33
|
Is there any way to reference the entry price in Realcode? For example, I'd like to jump to an alternate subroutine if a certain level of profit/loss is attained.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you are just looking at a single symbol at a time, you could have a variable for this:
Dim Entry As Single = 5
Or set up a UserInput which you could change whenever you switch symbols.
'# Entry = UserInput.Single = 5
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 5/20/2010 Posts: 33
|
Bruce, I'm looking for something much more dynamic. I'd like to write a routine that would use the entry price of system generated buy or sell signal for any given symbol, then branch to a different set of rules if a specific profit or loss is achieved.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If the entry price is algorithimically generated as part of the RealCode, then yes, you can use it. You would just assign it to a static variable when you generate it.
There is no way to reference the entry price used in BackScanner in RealCode however. So if you want that value, you would generally need to re-create the entire BackScan in your RealCode. This can be quite complicated.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 5/20/2010 Posts: 33
|
Ok Thanks Bruce.
In lieu of that, is there a way to steup conditional trading rules, such as stops or profit targets? For example: if a certain condition (rule) is met, then impose a 10% trailing stop.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can only kind of do this.
BackScanner Rules are evaluated from top to bottom. Once one of the rules returns true, the rest of the rules are not evaluated.
So you could add a BackScanner Rule set to Remain in Trade based on a condition of some sort and put it above your trailing stop rule in BackScanner. The trailing stop would not be able to trigger unless the Remain in Trade rule above it was False.
This means you would need to create the reverse of the condition you want to use to trigger the trailing stop to use as the trailing stop trigger,
Note that this is not a sequence. You couldn't have something like the condition triggering the trailing stop for the rest of the trade. If the condition reverts to a state where the Remain in Trade rule evaluates as true, the trailing stop won't trigger.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 5/20/2010 Posts: 33
|
Thanks again Bruce. I think I understand.
I wish you guys were still investing in this tool.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |