Trade FOREX with FXCM

  • Award-Winning Platform
  • 24/7 Customer Support
  • Trade Directly on Charts
  • Free $50K Practice Account
Register


Results 121 to 127 of 127
Page 9 of 9 FirstFirst ... 5 6 7 8 9

Thread: Single-line comment or end-of-line expected

  1. #121
    robocod's Avatar
    robocod is online now Member
    Join Date
    Mar 2011
    Posts
    259
    The code contains lots of stuff like this...

    Code:
    buyStop.Generate(StrategyInfo.AvgEntryPrice + 0.0020);
    which will work fine on Forex, the + 0.0020 means 20 pips. But this is not ok for CFDs (also not for JPY) because a pip on SPX500 for example is not 0.0001. So, the problem was that the stops/limits were being place much too close to the price, and they would trigger immediately.

    The "usual" method to convert from pips to price is to do this...

    Code:
    buyStop.Generate(StrategyInfo.AvgEntryPrice + 20 * (10 * Bars.Point));
    Which converts the pips to price using x10, is because Bars.Point is the value of a fractional pip (i.e. 0.00001 on EUR/USD for example).

    This should change now work for your SPX500 CFD

    However, unfortunately, this is not the end of the story, because most CFDs do not have factional pip pricing, e.g. UK100, and there doesn't seem any easy way to work around this other than having a lookup function which finds out if the conversion should be x10 or x1

  2. #122
    Ziklag is offline Member
    Join Date
    Nov 2008
    Posts
    85
    Hello,

    If a stEA calculates/determines position-size/numlot according to say Balance and the account setting performs rollover (auto position reset, close/open) midnight/close of market - whatever the time that happens everyday.
    If on a particular day a position is in the money such that position-size calculation/result would raise from say one to two; when rollover is performed is this change effected; do we see the new position change from one numlot to two numlots or would rollover never have anything to do with changing such things as position-size and is only concerned with rollover of position "as is" leaving all other factors constant?

    Regards

  3. #123
    jpschan is offline FXCM Automated Platform Specialist
    Join Date
    Dec 2010
    Posts
    1,061
    It won't change the position size of a open position. But you can generate extra lot with another order to handle this situation.

    Regards,
    jpschan

  4. #124
    Ziklag is offline Member
    Join Date
    Nov 2008
    Posts
    85
    Dear jpschan,

    In vain have I waited for a response to post #116 ... why is this?

    Regards.

  5. #125
    jpschan is offline FXCM Automated Platform Specialist
    Join Date
    Dec 2010
    Posts
    1,061
    Hi Ziklag,

    Please note that we are no longer providing free coding request on this forum. All this kind of request are with the lowest priority. Please consult our programming service if you want a immediate response.

    Forex Programming Services | Custom MT4 Strategy Programming

    Regards,
    jpschan

  6. #126
    Ziklag is offline Member
    Join Date
    Nov 2008
    Posts
    85
    Hi,

    Whatever Data Range 100, 500, 1000 Bars Back I set SWE30 doesn't get me the required bars - see image attached, thereby by failing attachment of both Indicators and Strategy Advisors due to "Not enough series length." Kindly advise.

    Regards.
    Attached Thumbnails Attached Thumbnails Single-line comment or end-of-line expected-swe30.jpg  


  7. #127
    jpschan is offline FXCM Automated Platform Specialist
    Join Date
    Dec 2010
    Posts
    1,061
    Hi Ziklag,

    Thanks for reporting. We are aware of this issue. SUI30, UKOil have the same problem getting historical data.

    Regards,
    jpschan

Page 9 of 9 FirstFirst ... 5 6 7 8 9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.