script to set sl tp in deposit currency?

 
when trading crypto, some of them are like 900 points from open to BE and others are only 200, as well as the difference between forex and for example natural gas or oil, the pip values are drastically different, as well as my broker has stop levels set, which sometimes (if your unfamiliar with  the instrument) can be overly far spaced apart. 100 pip difference minimum for gold isnt so bad, then for audusd is 120 which is way farther than any  other forex they offer.  my first request is for a script or ea that lests you set those levels in $$ value insstead of pips or points (which sometimes seem to be one and the same), my other inquiry is about the stop levels on chart. is there a way to bring the numbers from the far left of the line to the right side, like in the margin made by chart shit, or to make it bigger font? for the most part whenever im trying to adjust those levels i cant see how many pips im moving the line of the value of the stoploss because the chart and other objects cover it up. or maybe a script to shift the chart from the left side as well as the right? giving 2 margins of empty space to data. this would be super helpful when dealing with things that have irregular number of decimals like 0 or 3 as i often dont even know what th ehell it is im setting without looking ont he chart to see the vaules. if anybody has one of these laying around, or even aline of code to put into a mq4 file ive got of an existing sltp manager thatwould be great. im completelynew to coding mql but ive been modifying indicators by copying nd pasting from to the next and altering the parameters, itsbeen along process, i definately cnt write one from scratch, but ve made a few that i like to use that display desired info and stuff. any input/advice would be appreciated
 
kanabus87:
when trading crypto, some of them are like 900 points from open to BE and others are only 200, as well as the difference between forex and for example natural gas or oil, the pip values are drastically different, as well as my broker has stop levels set, which sometimes (if your unfamiliar with  the instrument) can be overly far spaced apart. 100 pip difference minimum for gold isnt so bad, then for audusd is 120 which is way farther than any  other forex they offer.  my first request is for a script or ea that lests you set those levels in $$ value insstead of pips or points (which sometimes seem to be one and the same), my other inquiry is about the stop levels on chart. is there a way to bring the numbers from the far left of the line to the right side, like in the margin made by chart shit, or to make it bigger font? for the most part whenever im trying to adjust those levels i cant see how many pips im moving the line of the value of the stoploss because the chart and other objects cover it up. or maybe a script to shift the chart from the left side as well as the right? giving 2 margins of empty space to data. this would be super helpful when dealing with things that have irregular number of decimals like 0 or 3 as i often dont even know what th ehell it is im setting without looking ont he chart to see the vaules. if anybody has one of these laying around, or even aline of code to put into a mq4 file ive got of an existing sltp manager thatwould be great. im completelynew to coding mql but ive been modifying indicators by copying nd pasting from to the next and altering the parameters, itsbeen along process, i definately cnt write one from scratch, but ve made a few that i like to use that display desired info and stuff. any input/advice would be appreciated

For your first request, try this script. Maybe it is what you are looking for.

https://www.mql5.com/en/code/download/18011/modify_sl_tp_with_price.mq4

 
kanabus87:

script to set sl tp in deposit currency?

  1. Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin and leverage. No SL means you have infinite risk. Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% total.

    1. You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.

    2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)

    3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
                MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum (2017)
                Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum (2018)
                Lot value calculation off by a factor of 100 - MQL5 programming forum (2019)

    4. You must normalize lots properly and check against min and max.

    5. You must also check FreeMargin to avoid stop out

    Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.

  2. Search for a GUI/Trade Assistant EA like mine (for MT4): 'Money Manager Graphic Tool' indicator by 'takycard' - Risk Management - Articles, Library comments - MQL5 programming forum - Page 6 #55 (2018) and modified for screen resolution #75 (2020.02.17)