stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Static Peak HiLo indicator
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5116
Page 1 of 3
Author:  Radar [ Wed Mar 15, 2017 5:29 am ]
Post subject:  Static Peak HiLo indicator

Hey Gang,

I've been using Steve's Peak HiLo indie for a while now, but the zooming out would do my head in (and my peepers), (especially since I change timeframes a lot), so I thought I'd add a zoom setting, but it ended up breaking the indie :(
I eventually got it to work without breaking things, but by then, I'd changed it so much that it no longer met Steve's original design purpose :(
So, anyways, here's what I ended up adding...
  • Added the ability to set the Zoom_Level.
    Added the ability to show/hide trade-lines for the higher timeframes.
    Added a column to user feedback that shows which direction to look for trades.
    Added an option to set which corner to put user feedback.
No longer valid since Mon, 22 Jan, 2018...
The indie was already coded to automatically change the Trading timeframe to the timeframe of the chart, so I added code to automatically adjust the higher timeframes accordingly.
The defaults are setup to change all TF's automatically (all TF's are set to "Current"), show all trade-lines, Zoom_Level set to 2, with user feedback parked in the top right corner.

Anyways, have a play ;)

Have fun!
Radar =8^)

edit Tue, April 4, 2017... Dydynamic added MN1 PHL. Find it here.
edit Mon, Jan 22, 2018... Changed a few options... Details here.
Author:  Wavegarrick [ Wed Mar 15, 2017 7:33 am ]
Post subject:  Static Peak HiLo indicator

Hi Radar,

Just had a look at the indicator...Looks great :good: No more using a magnifying glass :smile:

Thanks for this.

Cheers
Leon
Author:  Radar [ Wed Mar 15, 2017 9:58 am ]
Post subject:  Static Peak HiLo indicator

Hey Leon,
Wavegarrick » Wed Mar 15, 2017 6:03 pm wrote:Hi Radar,

Just had a look at the indicator...Looks great :good: No more using a magnifying glass :smile:

Thanks for this.

Cheers
Leon
That's why I wrote it ;)

Have fun!
Radar =8^)
Author:  Dexonite [ Wed Mar 15, 2017 11:10 am ]
Post subject:  Static Peak HiLo indicator

Wow Radar, this is awesome!!

Just one question, whenever I change time frames on my chart, say from M15 to M30, the feedback disappears and I have to open up indi's again and at least click on the indi and exit for the feedback to show up again. Is there a way to get around this, as in have it refresh/reprint, whenever you change time frames?

I don't want to seem ungrateful, just asking.
Author:  Radar [ Wed Mar 15, 2017 11:36 am ]
Post subject:  Static Peak HiLo indicator

Hey Dexonite,
Dexonite » Wed Mar 15, 2017 9:40 pm wrote:Wow Radar, this is awesome!!

Just one question, whenever I change time frames on my chart, say from M15 to M30, the feedback disappears and I have to open up indi's again and at least click on the indi and exit for the feedback to show up again. Is there a way to get around this, as in have it refresh/reprint, whenever you change time frames?

I don't want to seem ungrateful, just asking.
Well, that's a weird one :( The feedback is drawn in the initialisation phase, so it should redraw according to your original settings when you change timeframes, as indicators and EA's re-initialise each time you change timeframes.
I've gotta ask... Is the chart you have it on very busy (lots of CPU intensive indicators)? Try it on a naked chart, and see how it goes.

Have fun!
Radar =8^)
Author:  Dexonite [ Wed Mar 15, 2017 12:16 pm ]
Post subject:  Static Peak HiLo indicator

Heya Radar,

I fiddled a bit and it seems to be conflicting with MilaneseMarketInfo, I'll scratch and see if I can fix it myself (nooby tuning). Thanks for the speedy reply.

Thanks and many a green pip to you.

EDIT: Got it fixed, changed MilaneseMarketInfo to only delete its own objects instead of all objects. Lol, I think I enjoy tinkering more than trading :smile: Thanks again.
Author:  SteveHopwood [ Thu Mar 16, 2017 1:46 am ]
Post subject:  Static Peak HiLo indicator

Dexonite » Wed Mar 15, 2017 12:16 pm wrote: EDIT: Got it fixed, changed MilaneseMarketInfo to only delete its own objects instead of all objects. Lol, I think I enjoy tinkering more than trading :smile: Thanks again.
Keep on tinkering. It may be less profitable than trading but it one Hell of lot more fun. It is how I started a decade ago and look where we are now.

:xm:
Author:  Radar [ Thu Mar 16, 2017 6:02 am ]
Post subject:  Static Peak HiLo indicator

Dexonite » Wed Mar 15, 2017 10:46 pm wrote:Heya Radar,

I fiddled a bit and it seems to be conflicting with MilaneseMarketInfo, I'll scratch and see if I can fix it myself (nooby tuning). Thanks for the speedy reply.

Thanks and many a green pip to you.

EDIT: Got it fixed, changed MilaneseMarketInfo to only delete its own objects instead of all objects. Lol, I think I enjoy tinkering more than trading :smile: Thanks again.
Damn! Who'da thunk it!? ;) Glad you found the culprit ;)
It is fun to nut these things out :) I need to code more often, though... What used to be a 15 -20 minute job takes me days now :(
Use it or lose it ;)

Have fun!
Radar =8^)
Author:  sahtjor [ Fri Mar 17, 2017 7:12 am ]
Post subject:  Static Peak HiLo indicator

Dexonite » Wed Mar 15, 2017 1:16 pm wrote:Heya Radar,

I fiddled a bit and it seems to be conflicting with MilaneseMarketInfo, I'll scratch and see if I can fix it myself (nooby tuning). Thanks for the speedy reply.

Thanks and many a green pip to you.

EDIT: Got it fixed, changed MilaneseMarketInfo to only delete its own objects instead of all objects. Lol, I think I enjoy tinkering more than trading :smile: Thanks again.
Hi Dexonite, i'm don't have much programming skills could you tell me where to change MilaneseMarketInfo to only delete its own objects.

BTW his is great indicator Steve :good:

Thanks
Author:  Dexonite [ Mon Mar 20, 2017 7:58 pm ]
Post subject:  Static Peak HiLo indicator

Hi guys, sorry for the late response but happy to share what I found:

On line 106 of Milanese's indi I changed it to:

Code: Select all

if(ordersTotal!=OrdersTotal()) ObjectDelete(StringFind(ObjectName(i),"mod",0) > -1);
and proceeded to change all the profit outputs to include the letters "mod", ie. "modprofitLabel".

Code: Select all

         if(showPipProfit==true) 
           {
            total=OrdersTotal();
            ordersTotal=total;
            j=0;
            double lots;;
            for(i=0; i<total; i++) 
              {
               bool orderSelect=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
               if(Symbol()==OrderSymbol()) 
                 {
                  if(OrderType()==OP_BUYSTOP || OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLSTOP || OrderType()==OP_SELLLIMIT) continue;
                  j++;
                  if(OrderType()==OP_BUY) 
                    {
                     lots=OrderLots();
                     profit+=OrderProfit()+OrderSwap()+OrderCommission();
                     tradeValue=(Bid-OrderOpenPrice())/Point/multiplier;
                     if(tradeValue>0) tradeValueColor=Lime;
                     else tradeValueColor=Red;
                     if(profit>0) profitColor=Lime;
                     else profitColor=Red;

                     ObjectCreate("modprofitLabel",OBJ_LABEL,0,0,0);
                     ObjectSetText("modprofitLabel","Profit",10,"Arial Bold",ProfitLossColor);
                     ObjectSet("modprofitLabel",OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modprofitLabel",OBJPROP_XDISTANCE,sideAdjustment+120);
                     ObjectSet("modprofitLabel",OBJPROP_YDISTANCE,up_downShift+100);

                     ObjectCreate("modprofitValue",OBJ_LABEL,0,0,0);
                     ObjectSetText("modprofitValue",DoubleToStr(profit,2),10,"Arial Bold",profitColor);
                     ObjectSet("modprofitValue",OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modprofitValue",OBJPROP_XDISTANCE,sideAdjustment+10);
                     ObjectSet("modprofitValue",OBJPROP_YDISTANCE,up_downShift+100);

                     ObjectCreate("modopenTradeLabel"+IntegerToString(i),OBJ_LABEL,0,0,0);
                     ObjectSetText("modopenTradeLabel"+IntegerToString(i),"T"+IntegerToString(j)+", Buy "+DoubleToStr(lots,2)+"",8,"Arial Bold",commentColor);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_XDISTANCE,sideAdjustment+80);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_YDISTANCE,20*j+85+up_downShift+20);
                     ObjectCreate("modpipProfitValue"+IntegerToString(i),OBJ_LABEL,0,0,0);
                     ObjectSetText("modpipProfitValue"+IntegerToString(i),DoubleToStr(tradeValue,1),8,"Arial Bold",tradeValueColor);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_XDISTANCE,sideAdjustment+10);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_YDISTANCE,20*j+85+up_downShift+20);

                     continue;
                    }
                  if(OrderType()==OP_SELL) 
                    {
                     lots=OrderLots();
                     profit+=OrderProfit()+OrderSwap()+OrderCommission();
                     tradeValue=(OrderOpenPrice()-Ask)/Point/multiplier;
                     if(tradeValue>0) tradeValueColor=Lime;
                     else tradeValueColor=Red;
                     if(profit>0) profitColor=Lime;
                     else profitColor=Red;

                     ObjectCreate("modprofitLabel",OBJ_LABEL,0,0,0);
                     ObjectSetText("modprofitLabel","Profit",10,"Arial Bold",ProfitLossColor);
                     ObjectSet("modprofitLabel",OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modprofitLabel",OBJPROP_XDISTANCE,sideAdjustment+120);
                     ObjectSet("modprofitLabel",OBJPROP_YDISTANCE,up_downShift+100);

                     ObjectCreate("modprofitValue",OBJ_LABEL,0,0,0);
                     ObjectSetText("modprofitValue",DoubleToStr(profit,2),10,"Arial Bold",profitColor);
                     ObjectSet("modprofitValue",OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modprofitValue",OBJPROP_XDISTANCE,sideAdjustment+10);
                     ObjectSet("modprofitValue",OBJPROP_YDISTANCE,up_downShift+100);

                     ObjectCreate("modopenTradeLabel"+IntegerToString(i),OBJ_LABEL,0,0,0);
                     ObjectSetText("modopenTradeLabel"+IntegerToString(i),"T"+IntegerToString(j)+", Sell "+DoubleToStr(lots,2)+"",8,"Arial Bold",commentColor);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_XDISTANCE,sideAdjustment+83);
                     ObjectSet("modopenTradeLabel"+IntegerToString(i),OBJPROP_YDISTANCE,20*j+85+up_downShift+20);
                     ObjectCreate("modpipProfitValue"+IntegerToString(i),OBJ_LABEL,0,0,0);
                     ObjectSetText("modpipProfitValue"+IntegerToString(i),DoubleToStr(tradeValue,1),8,"Arial Bold",tradeValueColor);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_CORNER,showOnRightTop);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_XDISTANCE,sideAdjustment+10);
                     ObjectSet("modpipProfitValue"+IntegerToString(i),OBJPROP_YDISTANCE,20*j+85+up_downShift+20);

                    }
                 }
              }
           }
        }
  
I include this code here but please don't just copy as I have heavily adjusted it to fit my retina display (it just looks horrid on a 13" Mac running Win7 on a retina) It should give you an idea of what I did.

THe two indi's work fine together now. Once you close your positions the pip values might still display but if you change the timeframe they disappear. It's not perfect but I'm happy with what I've accomplished thus far lol.
Setup.PNG
This what my setup looks like, trying to keep it naked :roll:
All times are UTC Page 1 of 3