budget & Timeframe for autom. strategy

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #11417 quote
    LeonLeon
    Participant
    Junior
    Hello, i don’t want the system to hold positions over night and i found this code:

    DEFPARAM FlatAfter = HHMMSS

    for exammple:

    DEFPARAM FlatAfter = 200000

    but how to make sure that it will start again tomorrow morning at 08:00 o clock?   Another point i am thinking of: Is there a possibility to code that the system shall just trade till max. 1,000.00€ lost under start budget ? I want to make sure that it wont use all of the money that is available.   Appreciate every help here! Best Regards Leon
    #11443 quote
    absent1980absent1980
    Participant
    Average
    Use flatbefore and flatafter. It will only trade between those hours. Regarding your second question, I’m not sure what you mean? Is it stop loss you are talking about? If yes then: Set stop $loss 1000 Hope it helps.
    #11444 quote
    LeonLeon
    Participant
    Junior
    Hi, thanks for the respond! I will handle the trimeframe as you said.   To specify my second question: I mean if my trading account is about 10,000.00 €. And i want to limit the strategy to, in case all goes wrong, stop render after using max 1,000.00€ from the account. Is there a way to code that?
    #11459 quote
    YannickYannick
    Participant
    Veteran
    Hi You can use the test If strategyprofit<-1000 then notrade=1 Endif Regards  
    #11460 quote
    LeonLeon
    Participant
    Junior
    Thanks Yannick!
    #12037 quote
    LeonLeon
    Participant
    Junior
    Hi, i tried it but “If strategyprofit<-1000 then notrade=1” is not working. Im getting Syntax Error. Any ideas how to limit profitloss of a system to -1.000.00 €?   Regards Leon
    #12043 quote
    NicolasNicolas
    Keymaster
    Legend
    Hi Leon, You can use STRATEGYPROFIT and test if it returns a value below your allowed loss limit:
    if STRATEGYPROFIT <-1000 then 
     notrade = 1
    else
     notrade = 0
    endif
    
    if notrade=0 and BUYcondition then 
     BUY 1 CONTRACT AT MARKET 
    endif 
    #12066 quote
    DavidDavid
    Participant
    Veteran
    Why wouldn’t use the programmed Quit function instead?
    if STRATEGYPROFIT <-1000 then 
     QUIT
    endif
    #12067 quote
    LeonLeon
    Participant
    Junior
    Thanks for your quick answer – will try both 😉 Regards Leon
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

budget & Timeframe for autom. strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Leon @leon Participant
Summary

This topic contains 8 replies,
has 5 voices, and was last updated by LeonLeon
10 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/09/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...