Announcement

Collapse
No announcement yet.

why isnt this working?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • why isnt this working?

    hey guys, im a bit rusty with EFS, when i apply this to a chart, i dont see any trades occurring but i cant figure out whats wrong.

    i am trading currencies by the way, thats what the Delta multiplier is for



    PHP Code:
    function preMain() {
        
    setStudyTitle("Test");
        
    setCursorLabelName("return"0);
        
    setColorPriceBars(true);
        
    setPriceStudy(true);

    }

    var 
    LastEntry null;

    function 
    main() {
    var 
    Delta 10000;
    if (
    getSymbol().match("JPY") == "JPY"Delta 100;


    if (
    Strategy.isLong() && high() >= LastEntry + (500 Delta)) Strategy.doSell(""Strategy.LIMITStrategy.THISBARLastEntry + (500 Delta))
    if (
    Strategy.isLong() && low() <= LastEntry - (250 Delta)) Strategy.doSell(""Strategy.LIMITStrategy.THISBARLastEntry - (250 Delta))

    if (
    Strategy.isShort() && low() <= LastEntry - (500 Delta)) Strategy.doCover(""Strategy.LIMITStrategy.THISBARLastEntry - (500 Delta))
    if (
    Strategy.isShort() && high() >= LastEntry + (250 Delta)) Strategy.doCover(""Strategy.LIMITStrategy.THISBARLastEntry + (250 Delta))


    if (
    getHour() == && getMinute() == && Strategy.isInTrade() == false() && sma(299) > sma(299,-1)) {
        
    Strategy.doLong(""Strategy.LIMITStrategy.THISBARStrategy.DEFAULT, close())
        
    LastEntry close()
    }

    if (
    getHour() == && getMinute() == && Strategy.isInTrade() == false() && sma(299) < sma(299,-1)) {
        
    Strategy.doShort(""Strategy.LIMITStrategy.THISBARStrategy.DEFAULT, close())
        
    LastEntry close()
    }


    setPriceBarColor(Color.RGB(128,128,128))
    if(
    Strategy.isLong() == truesetPriceBarColor(Color.RGB(0,255,0))
    if(
    Strategy.isShort() == truesetPriceBarColor(Color.RGB(255,0,0))

    return 
    sma(299);


    Last edited by kalzenith; 02-26-2010, 06:55 AM.

  • #2
    found it, for some silly reason i used the expression "false()" instead of "false".. dont ask me why

    Comment

    Working...
    X