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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    67 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    202 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    366 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    283 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X