Announcement

Collapse
No announcement yet.

one trade per bar (1 minute)

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

  • one trade per bar (1 minute)

    I downloaded the "AutoTrade_MA.efs" study (attached file). And I like to add a line that it will trade only one time per bar ( 1 minute). I tried to add the following 2 lines, but it didnĀ“t worked. Any ideas?

    ... && (lastTradeTime != getValue("rawtime",0))) { ...
    ... lastTradeTime = getValue("rawtime",0); ...

    regards
    sams
    Attached Files

  • #2
    Hello sams,

    With this particular formula, it's a little more complicated to add some logic to prevent multiple trades on the same bar. The better solution for you with this formula is to adjust the Stop Percentage through Edit Studies. The default is 0.25 percent, which may be too tight for the symbol you're using. Try increasing this parameter to 4 or 5, which corresponds to a 4.0% or 5.0% stop. If you want to change the default, change the value in line 88.

    fp5.setDefault(0.25); // 1 = 1.00%
    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