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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    89 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X