Announcement

Collapse
No announcement yet.

efs questions from arieal

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

  • efs questions from arieal

    Hi
    Here are a few entry level questions:
    1. When does the efs run inside every bar? at the begining, middle or after the end of bar (I use tick bars).
    2. If I want to go Long for example as follows (pseudo code):
    if close() >= MAStudy(10,...)
    Stratety.doLong( "Crossing Up",
    Strategy.MARKET,
    Strategy. NEXTBAR);

    then if current bar closes above MA, can I still get the Open price of the Next bar?
    To get the Closing price efs has to run After the Current bar, when the Next bar is already open, so how can I still get the Open price?
    Or maybe close() returns really the price of current time when efs runs and not the bar's closing price? doesn't make sense.
    3. There is any way to get a trade in Real Time, i.e. not at open or close bar bar current Market price? Maybe using StopBuy? That would be the only way?
    4. Strategy Analyzer: I trade YM (Dow emini) where one point is $5. How do I display the Profit in terms of Dollars and not in Points?
    Thats it for now, many thanks, Arie

  • #2
    Arie
    1. In real time unless you are using setComputeOnClose() an efs executes on every trade. However with some electronically traded contracts (such as ES or NQ) an efs will execute only under the following conditions when using minute based charts
    - Current trade price is different than the previous trade price.
    - Current trade price is at the bid and previous trade was at the ask and vice versa. The two trade prices can be the same in this instance.
    On historical bars an efs executes instead only once per bar.
    2. You can in back testing but not in real time. In the latter case you would check for the conditions to exist at the prior bar and then trigger the entry at Strategy.MARKET, Strategy.THISBAR on the first tick of a new bar.
    3. You can use Strategy.STOP and Strategy.LIMIT to set specific entry/exit points
    4. In the Default Lot Size box insert the dollar value per contract per number of contracts traded. For example if you trade 3 YM contracts then use 15 (5$/contract X 3 contracts)
    Alex

    Comment


    • #3
      Guide to Developing Real-Time Strategies

      Dear Alex
      Many thanks for your very prompt and clear reply.
      Here are some more questions:
      5. The 'Guide to Developing Real-Time Trading Strategies in eSignal' is mentioned in 'Guide to Developing EFS Graphics' but I couldn't find it. Could you help?
      6. If EFS runs every tick (in a YM tick chart for example) than IBBroker.Buy(...MARKET..) will buy in real time at this or next tick (provided enough liquidity of course), and not at the close or open of next bar.
      7. Same question for PaperTradeBroker.Buy(...MARKET...)?
      8. How to Stop an EFS from running? How to Manualy Close/Cover a transaction initiated by EFS to InteractiveBrokers?
      9. For trading with IB, there are available only Buy/Sell/OrderEntry?
      I understand that I need to provide myself with equivalents of Strategy.isInTrade(), getPositionSize(), and other Strategy functions?
      10. IBBroker.Buy(...MARKET..) returns OK if trade succeded?
      11. How do I know Fill price and positions with IB?
      12. How do I trade with several IB accounts simultaneously, running different EFS's on different charts?
      Thanks very much,
      Arie

      Comment


      • #4
        Hi ariel,

        The 'Guide to Developing EFS Graphics' is contained in the EFS knowledgebase. Here is how to get there...

        first, select eSignal University tab...



        Then Select KnowledgeBase under the Resources header...



        Then Select Guide to Developing EFS Grapics...



        hope that helps answer that one question.

        Comment


        • #5
          Steve,
          thanks for your info, but what I need is the 'Guide to Developing Real-Time Trading Strategies in eSignal' and not the guide for efs graphics.
          The real-time guide was mentioned in the efs guide.
          Arie

          Comment


          • #6
            Hi ariel,

            oops, sorry, I selected the wrong one to search for. I do not believe a 'Guide to Developing Real-Time Trading Strategies in eSignal', by that name, was ever written. However, there is a "Guide to Developing eSignal Strategies" in the KnowledgeBase.

            Comment


            • #7
              RT Strategies...

              I wrote most of the "Guides". At the time, I was about 6 months into EFS and was "learning" how to accomplish alot of the most advanced stuff. The "Guide to Graphics" was my last effort and was part of a big project I worked on for clients. The final result of the "Guide to Graphics" is a "trendline system" that uses some fo the advanced features of EFS...

              For Real-time strategies (and most other EFSs), I have developed a set of variables (like a template) that allows me to create nearly anything for anyone.

              You can check out this thread for my examples...

              If you have any questions regarding developing an EFS for realtime, let me know - I've done alot of this..

              B
              Brad Matheny
              eSignal Solution Provider since 2000

              Comment


              • #8
                Answers...

                Here are some more questions:

                5. The 'Guide to Developing Real-Time Trading Strategies in eSignal' is mentioned in 'Guide to Developing EFS Graphics' but I couldn't find it. Could you help?

                --- Fire any questions you have at me and use the link I provided in the earlier post

                6. If EFS runs every tick (in a YM tick chart for example) than IBBroker.Buy(...MARKET..) will buy in real time at this or next tick (provided enough liquidity of course), and not at the close or open of next bar.

                --- Correct - the IBBroker.Buy will fire off an order. There it gets filled depends on the market conditions at the time - but it is not guaranteed to fill AT any specific price.

                7. Same question for PaperTradeBroker.Buy(...MARKET...)?

                --- As far as I can tell, the PaperTradeBroker.Buy fills at the current (last) price. So, if you fired off a buy at 1180.50, it would fill at 1180.50.

                8. How to Stop an EFS from running? How to Manualy Close/Cover a transaction initiated by EFS to InteractiveBrokers?

                -- This is where I use buttons. You can visit my web site and download the trial of the "TradeButtons" app. Within all of my RT EFS files, I track the conditions and status of the system. So, I can create buttons to manually "CLOSE" any open trade at any time.

                9. For trading with IB, there are available only Buy/Sell/OrderEntry?
                I understand that I need to provide myself with equivalents of Strategy.isInTrade(), getPositionSize(), and other Strategy functions?

                -- With the eSignal "IBBroker" function, you are provided BUY,SELL and MARKET/LIMIT/STOP type orders. I like using Dynaorder (www.dynaorder.com) because it provides a more feature-rich solution for EFS. One can track fill prices, fill amounts, and place various types of orders. In my opinion, it is much better for developing systems than the IBBroker plugin.

                10. IBBroker.Buy(...MARKET..) returns OK if trade succeded?

                --- I don't believe it returns anyting - it just launches your order.

                11. How do I know Fill price and positions with IB?

                --- See Dynaorder (#9)

                12. How do I trade with several IB accounts simultaneously, running different EFS's on different charts?

                --- This is something that Dynaorder WAS supposed to address a while back. I don't believe they have yet. The only answer I know of is to use the "FA" feature of IB (thus setting up unique account "pairs or settings", then passing the FA account information to Dynaorder with your systems calls.

                Thanks very much,
                Arie
                Brad Matheny
                eSignal Solution Provider since 2000

                Comment


                • #9
                  Brad
                  Many thanks for your prompt and helpful reply.
                  Here are some more newbe questions:
                  13. PaperTradeBroker.getHolding(getSymbol()) returns number of trades (roughly) instead of positions?
                  14. Same problem with BrokerWindow/eSignal PaperTrade, tab Portfolio, field Quantity, doesn't display open positions but number of trades (more or less).
                  15. BrokerWindow/eSignal PaperTrade, tab Summary, fields ...P/L
                  are calculated based on what info? I use YM on tick charts.
                  Here, the Holding field shows OK, that I have one contract open.
                  Thanks
                  Arie

                  Comment


                  • #10
                    Asnwers...

                    13. PaperTradeBroker.getHolding(getSymbol()) returns number of trades (roughly) instead of positions?

                    -- I assume so. I have never tried this as I keep track of my systems actions/status within my code.. I would assume though this call would return the #OfShares you are holding for the particular symbol.

                    14. Same problem with BrokerWindow/eSignal PaperTrade, tab Portfolio, field Quantity, doesn't display open positions but number of trades (more or less).

                    -- This field DOES show the number of open SHARES/CONTRACTS. Because of the way the PaperTrader works, positive numbers are LONG and negative numbers are SHORT.

                    15. BrokerWindow/eSignal PaperTrade, tab Summary, fields ...P/L calculations....

                    -- if long - EXIT price - ENTRY price
                    if Short - ENTRY price - EXIT price.

                    You should be trading contracts equal to the number of $$ per point move (for futures). For example, for the ES - trade 50 per lot.

                    B
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment


                    • #11
                      Hi
                      Here is one more question:
                      16. I've seen in Brad Matheny's code Sample_TargetStop.efs and also D. Loomis mentioned this: code put in to prevent new entry on the same bar that an exit trade occured.
                      I would like to understand why is this important? Why not enter a trade in the same bar I did an exit? It may be a Reverse enter.
                      The only reason I might see is because of the misleading entry price using open() to assign the price when actually this price is late.
                      Thanks, Arie

                      Comment


                      • #12
                        Some more questions:
                        17. For PaperTrade, if I want to limit the time to trade, for example
                        if I want to start trading after 10am est. I use:

                        if ((getHour()*100 + getMinute()) < 1000) return;

                        What do I use for Backtesting for the same condition?

                        18. What's the difference between variable time from
                        var time = new Date(); and from
                        var time = getValue("Time", 0);

                        What to use for Backtesting and what for Papertrade to limit the time to trade?

                        Comment


                        • #13
                          Hello Arie,

                          16. This one really depends on the specific logic of the EFS in question and whether you are using it for back testing in the Strategy Analyzer or real time testing with the paper broker. In back testing, the EFS only processes once per bar. We don't have the luxury of analyzing the intrabar trades like we do in real time. So if you use Strategy.MARKET/Strategy.THISBAR to enter the position, it may not be realistic if the condition used to enter the position was based on the high or low of the bar. This combo would be ok as long as the condition to enter the position was based on the open price of the bar. In that case, you could exit on the same bar as the entry and still have a logical result. Most often, people use MARKET/NEXTBAR to enter the position at the open of the bar that follows the signal bar. It would also be logical in this case to exit on that bar as well. Did this help?

                          17. You would use the same condition as those functions return the start of the bar regardless of back test mode or real time.

                          18. new Date() creates a date object based on your PC clock. It wouldn't matter which bar was being processed. The date would reflect the current date and time. getValue("Time") returns a date object based on the start time of the bar currently being processed. It will reflect the date and time at the start time for each bar.
                          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