Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding Candle Close Strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding Candle Close Strategy

    I have a functioning code that uses this type of format. I have a bunch of parameters that all need to be true at the same time for an entry, so I am thinking of adding this in to test a theory I have been thinking for my scalp trades. This would be looking at entering a short looking for a continuation with my other parameters. Is there a way for me to do this shorthand and have the ability to create an extra variable that allows me to test the previous certain number of candles or do they have to be written out each time. It's obviously not too difficult to add another Close[x+?]<Close[x+?] just looking to simplify my replay tests.

    && (EntryCandleDirection ? (Close[x] < Close[x+1] && Close[x+1] <Close[x+2] && Close[x+2] < Close[x+3] && Close[x+3] < Close[x+4] && Close[x+4] < Close[x+5] && Close[x+5] < Close[x+6] && Close[x+6] < v[x+7]&& Close[x+7] < Close[x+8]&& Close[x+8] < Close[x+9]) : Close[0] > 0)​

    #2
    Hi durdcash, thanks for posting. The code here can be placed inside it's own method that returns a boolean e.g.

    private bool MyBoolVariable()
    {
    return ((EntryCandleDirection ? (Close[x] < Close[x+1] && Close[x+1] <Close[x+2] && Close[x+2] < Close[x+3] && Close[x+3] < Close[x+4] && Close[x+4] < Close[x+5] && Close[x+5] < Close[x+6] && Close[x+6] < v[x+7]&& Close[x+7] < Close[x+8]&& Close[x+8] < Close[x+9]) : Close[0] > 0)​);
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X