Forums › ProRealTime English forum › ProOrder support › Trend surfer DAX modified › Reply To: Trend surfer DAX modified
So ! I rewrote the code to make the conditions work and each one is tested in an indicator (see attached).
signal_squeeze1 :
- negative surface for down supertrend and positive surface for up supertrend
- red spikes for short signals and green spikes for long signals
signal_squeeze2 :
- red spikes for short signals AND down supertrend
- green spikes for long signals AND up supertrend
signal_squeeze2 is used by the system to enter a position, and supertrend to exit (plus money management). But it’s not the case as you can see.
Soooooooo, now that I narrowed down the problem, i’m deducing that the only part of the code which could be the problem is the part below, where the system buys and sells, Elementary my dear Watson !
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
//signal1 : buy signal //signal2 : sell signal //lol[1] = -1 : down supertrend //lol[1] = 1 : up supertrend if signal2 then IF LONGONMARKET THEN SELL AT MARKET SELLSHORT 5 SHARES AT MARKET ELSE SELLSHORT 5 SHARES AT MARKET ENDIF ENDIF if signal1 then IF SHORTONMARKET THEN EXITSHORT AT MARKET BUY 5 SHARES AT MARKET ELSE BUY 5 SHARES AT MARKET ENDIF ENDIF IF LONGONMARKET and lol[1]=-1 THEN SELL AT MARKET ENDIF IF SHORTONMARKET and lol[1]=1 THEN EXITSHORT AT MARKET ENDIF |
I finally found the problem and I’m really having fun doing this, but now i’m stuck, and this has been already for a few hours, could someone help please ?
chears !
PS : the entire code is also attached if needed