Combine manual trading with algo

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #241310 quote
    CrillezzCrillezz
    Participant
    Veteran

    Hello everyone!
    Since I am very bad at keeping my plan when I trade manually, I would like to have an algo that helps me with that.

    Example: When I see a good setup. I want to go long and I know my Stop and Target. I write down my stoploss and target in my algon. And the algo does the rest.

    After I type SL=40p/TP=80p and startded the algo I want it to take 4 contracts.

    When it has 20p profit from entry, it should close 1 contract. My profit will be 20p/4contracts=5. Then my new SL will be 45p.

    f the price goes in my favor to 40p, it will close 1 more contract. My profit will then be 20p/3 contracts=6.66p
    Then my new SL = 51.6 From entry. and so on until the price reaches my SL or TP.

    It would help me a lot.

    #241327 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hello, here is a possible solution.
    Once you want to enter the market then you can start the system. The best thing to do is to do it at a low timeframe so that it starts as soon as possible.

     

    defparam cumulateorders=false
    once check=1
    
    if not onmarket and check=1 then
    buy 4 contracts at market
    set stop ploss 40
    set target pprofit 80
    endif
    
    if onmarket and not onmarket[1] then
    check=0
    buyprice=tradeprice
    newsl=buyprice-40*pipsize
    tp1=buyprice+20*pipsize
    tp2=buyprice+40*pipsize
    tp3=buyprice+80*pipsize
    firstlevel=0
    secondlevel=0
    endif
    
    if onmarket and close > tp1 and firstlevel=0 then
    firstlevel=1
    sell 1 contract at market
    set stop ploss 45
    newsl=buyprice-45*pipsize
    endif
    
    if onmarket and close>tp2 and secondlevel=0 then
    secondlevel=1
    sell 1 contract at market
    set stop ploss 51.6
    newsl=buyprice-51.6*pipsize
    endif
    
    //graphonprice newsl coloured("red")
    //graphonprice tp1 coloured("blue")
    //graphonprice tp2 coloured("green")
    //graphonprice tp3 coloured("orange")
    Crillezz thanked this post
    #241463 quote
    CrillezzCrillezz
    Participant
    Veteran

    Thank you very much. Exactly what I was looking for. Could you please help me with a code that can go short?

    I’ve tried, but can’t get it to work.

    #243947 quote
    MedvediaMedvedia
    Participant
    New

    You can manually pause the algo when needed and restart it later, but be careful with position sizes and potential conflicts. A simple button-based intervention might work for quick manual adjustments.

    #243950 quote
    PeterStPeterSt
    Participant
    Master

    Yea, sure.
    bye

    #244537 quote
    PeterStPeterSt
    Participant
    Master

    I was waiting for that.

Viewing 6 posts - 1 through 6 (of 6 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

Combine manual trading with algo


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Crillezz @crillezz Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by PeterStPeterSt
1 year, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/10/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...