I have an EFS that I'd like to have auto-trade, but I want to do it on paper. Can the paper trader feature be made to auto trade? I can't seem to get it to work if so...
Thanks Michael... unfortunately I'm still stuck. I did find several posts by Brad Metheny that included .efs code to do this, but I'm no coder so can't quite get his code to work with my wizard-generated efs via cut & paste. It does seem to be exactly what I'm looking for, just have to figure out how to make it work with the siganls I'm using already (which are incredibly basic).
I want to trade on bars with volume higher than the previous bar, and trade in the direction of the price close (long if close higher than previous close, short if lower than previous close, but ONLY on higher volume bars).
It was incredibly easy to set this up via the wizard, but it's the papertrading component I can't figure out how to integrate.
Thanks anyway though. Anyone else have a simple explanation of how to integrate the papertrader? I would love to actually understand how it works, rather than just cut & paste code, but in the end I just want it to work so cut & paste is better than nothing...
Thanks Brad... I read the thread and unfortunately did not come away any better informed than I am currently.
My problem is not (yet anyway) one of time stamping... I can't even figure out how to get my system to USE the papertrader! Perhaps I should attach some code...
Here is my complete system from the Wizard:
************************************************
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vLastAlert = -1;
//}}EFSWizard_Declarations 2482
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("High Volume Move");
//}}EFSWizard_PreMain 8299
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
It works as desired, but is not ultimately what I plan to use, it is merely the start from where I want to begin refining it. I get my arrows on the chart where they should be, but now I can't figure out how to link those arrows to be trades in papertrader.
I'm no coder, and usually create things like this via cut & paste semi-haphazardly until they work (and you'd be amazed how often they *do* work! =)
I have toyed with adding lines from code you supplied someone else:
But when I put these lines where they seem to need to go (the first up with the other variable declarations and the second in the long action portion of my strategy), nothing happens. This is what I wound up with that doesn't work:
Since I really *don't* know what I'm doing, can you point me in the right direction? I would think that within any doLong there would simply be a method to designate to what broker the order was being sent, like:
At the very top of your EFS - this line envokes the Paper Trader module. You have to install the Paper Trader Module from the TRADE menu before this will work.
Now, to issue trades, you have to use the following commands...
Hi again, and yes it helps tremendoulsy, but I realized after my last post that you'd probably mention declaring PTrade, which I *did* have in my code. Here is the actual code, in its entirety, after I tried cut & pasting it together...
*************************************
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vLastAlert = -1;
var PTtrade = new PaperTradeBroker;
var Contracts = 100;
//}}EFSWizard_Declarations 2482
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(true);
setStudyTitle("High Volume Autotrader");
//}}EFSWizard_PreMain 8299
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
So as you can see, I did declare both PTrade and Contracts, but I must be implementing them incorrectly somehow later on, because they don't actually work. Nothing happens at all when a trade signal comes through... No trades, just my bars changing color as expected. Where have I gone wrong?
Also, how do I actually get it to Net Reverse? If I am currently flat, I would want it to buy 100 contracts for example, which means to reverse I sell 200, but how do I make the system check if I'm flat, or need to reverse?
Oh also, what do you mean about "installing" the papertrader? I didn't have to do anything like that and it works fine, just not in my system...
Thanks again, your help is tremendously appreciated by the Esignal novice...
Comment