Several traget profits

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #42806 quote
    AlbaranAlbaran
    Participant
    Average

    Hi all,

    I’m having some trouble setting up several target profits in the same automated trading. The idea is to decrease the target profits the longer a trade is on market, so my code looks like this:

    if longonmarket and barindex - tradeindex(1) <= 1 then
    SET TARGET $PROFIT 50
    elsif longonmarket and barindex - tradeindex(1) > 1 and barindex - tradeindex(1) <= 3 then
    SET TARGET $PROFIT 30
    elsif barindex - tradeindex(1) > 3 then
    sell at market
    endif
    
    Set stop ploss 20

    Only thing is, this doesn’t seem to be working in backtesting

    Any ideas?

    Thanks.

Viewing 1 post (of 1 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

Several traget profits


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Albaran @albaran Participant
Summary

This topic contains 1 voice and has 0 replies.

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