Announcement

Collapse
No announcement yet.

Problem with Order Price

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

  • Problem with Order Price

    I am having some problem with the fill price that i get using the:

    Strategy.doLong("Go Long", Strategy.CLOSE, Strategy.THISBAR);

    Basically, what i want it to do is to ENTER the LONG at the close of the current BAR. Whereas, for some reason, it always enters me at the close of the previous bar. I know it is a small problem but due to the lack of information available in EFS knowledgebase i am having this problem. Same is the case with .doShort.

  • #2
    Hello subhiii,

    I don't think the problem lies with that single line of code. Please attach your complete formula so I can test it on my end. The code you provided should be returning the close of the current bar that is being processed.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Subhiii
      it might be caused if you are using SetComputeOnClose()

      try changing the wording THISBAR to NEXTBAR so you have the following,


      Strategy.doLong("Go Long", Strategy.CLOSE, Strategy.NEXTBAR);

      Last edited by shogun; 03-08-2005, 03:46 PM.

      Comment


      • #4
        if ( aArray[0] < aArray[1] && aArray[0] < BBBasis) {
        if ( aArray[1] > BBBasis ) {


        if ((Strategy.isInTrade() == true) && (Strategy.isShort() == true)) {

        Strategy.doCover("Exit Short", Strategy.CLOSE, Strategy.THISBAR);
        Strategy.doLong("Go Long", Strategy.CLOSE, Strategy.THISBAR);

        getTarget = setTargetTime();
        EntryPrice = close(0);
        nStopPrice= (EntryPrice - 2.00);
        chkTarget = true;

        }else {if (Strategy.isInTrade() == false) {
        Strategy.doLong("Go Long", Strategy.CLOSE, Strategy.THISBAR);
        // DrawShapeRelative(0,low(), Shape.UPARROW, Color.Green, Image.ONTOP,"Buy");

        EntryPrice = close(0);
        // Change this incase want to change Targets according to time
        getTarget = setTargetTime();
        chkTarget = true;
        nStopPrice=(EntryPrice - 2.00);
        }}
        }

        }else {if (aArray[0] > aArray[1] && aArray[0] > BBBasis){
        if (aArray[1] < BBBasis) {

        if ((Strategy.isInTrade() == true) && (Strategy.isLong() == true)) {
        Strategy.doSell("Exit Long", Strategy.CLOSE, Strategy.THISBAR);
        Strategy.doShort("Go Short", Strategy.CLOSE, Strategy.THISBAR);


        EntryPrice = close(0);

        getTarget = setTargetTime();
        chkTarget = true;
        nStopPrice=(EntryPrice + 2.00);

        }else {if (Strategy.isInTrade() == false){
        Strategy.doShort("Go Short", Strategy.CLOSE, Strategy.THISBAR);

        EntryPrice = close(0);
        // Change this incase want to change Targets according to time
        getTarget = setTargetTime();
        chkTarget = true;
        nStopPrice=(EntryPrice + 2.00) ;
        }}
        }
        }}

        Comment


        • #5
          Hello subhiii,

          Thank you for posting more of your code. However, it is not apparent what the problem might be by only looking at this set of code. In order to verify the problem you are describing and provide a solution, I need to test the formula on my end. Please use the attachment feature when replying to attach your complete formula.
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment

          Working...
          X