Conversion of a proRealTime code to EasyLanguage

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #122524 quote
    elabed
    Participant
    New
     //Definition of code parameters
    
    DEFPARAM CumulateOrders = False  //Cumulating positions deactivated
    
     //The system will cancel all pending orders and close all positions at 000. No new ones will be allowed until after the FLATBEFORE time.
    
    DEFPARAM FLATBEFORE = 090000
    
     //Cancel all pending orders and close all positions at the FLATAFTER time
    
    DEFPARAM FLATAFTER = 173000
    
     
    
    // Conditions to enter long positions
    
    indicator1 = Average[10](Stochastic[36,10](totalPrice))
    
    indicator2 = Stochastic[36,10](totalPrice)
    
    c1 = (indicator1 CROSSES UNDER indicator2)
    
     
    
    IF c1 THEN
    
    BUY 1 SHARES AT MARKET
    
    ENDIF
    
     
    
    // Conditions to enter short positions
    
    indicator3 = Average[10](Stochastic[36,10](totalPrice))
    
    indicator4 = Stochastic[36,10](totalPrice)
    
    c2 = (indicator3 CROSSES OVER indicator4)
    
     
    
    IF c2 THEN
    
    SELLSHORT 1 SHARES AT MARKET
    
    ENDIF
    
     
    
    // Stops and targets
    
    SET STOP pLOSS 30 pTRAILING 18

     

    Hi Everyone,

    i’d like to convert this code to easyLanguage  but I don’t have any knowledge with easyLanguage . Anyone can help, please !

    code.txt
    #122527 quote
    robertogozzi
    Moderator
    Master

    Free conversions are only done for code written in other languages to PRT.

    The other way round is available as paid service at https://www.prorealcode.com/trading-programming-services/.

    #122623 quote
    elabed
    Participant
    New

    ok, I’m sorry. It’s just for a school project

    #122687 quote
    Zigo
    Participant
    Master
    Defparam cumulateorders =false
    defparam flatbefore = 090000
    defparam flatafter = 173000
    
    //parameters
    
    a1=Stochastic[36,10](totalprice)
    a2 = Average[10](Stochastic[36,10](totalPrice))
    
    // Conditions to enter long positions
    
    if a1 crosses over a2 then
    buy 1 share at market
    ENDIF
    
    // Conditions to enter short positions
     
    IF a1 crosses under a2 THEN
    SELLSHORT 1 SHARES AT MARKET
    ENDIF
    // Stops and targets
     
    SET STOP pLOSS 30 pTRAILING 18
    
    ideaElabed.png ideaElabed.png
    #122689 quote
    Zigo
    Participant
    Master

    I don’t know which timeframe you had in mind?

    #122702 quote
    Zigo
    Participant
    Master
    A little bit juggle whith the bactest, there are things possible I think.
    idea2Elabed.png idea2Elabed.png
    #122708 quote
    robertogozzi
    Moderator
    Master

    @Zigo   Are you sure this is the EasyLanguage version?

    Moreover, line 23 is not accepted by PRT, only one type of SL at a time. For trailing stops it’s recommended to use code snippets rather than built-in instrucions.

    #122713 quote
    Zigo
    Participant
    Master

    Wat I have done, see attachement

    idea3Elabed.png idea3Elabed.png
    #122718 quote
    Nicolas
    Keymaster
    Master

    @Zigo I think you are off topic 🙂

    elabed was asking for easylanguage code conversion, which we don’t supply. By the way, you seem to have fun by playing with the code he provided! !lol!

    #122725 quote
    elabed
    Participant
    New

    Thank you all for your reply.


    @Nicolas
    yes i know that you don’t supply conversions for free but will be grateful if anyone can help me.

    #122728 quote
    Nicolas
    Keymaster
    Master

    No one will provide code for easylanguage on this forum. I close the topic.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Conversion of a proRealTime code to EasyLanguage’ is closed to new replies.

Conversion of a proRealTime code to EasyLanguage


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
elabed @elabed Participant
Summary

This topic contains 10 replies,
has 4 voices, and was last updated by Nicolas
5 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/19/2020
Status: closed
Attachments: 4 files
Logo Logo
Loading...